summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/fwl_noteimp.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-27 15:28:25 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-27 15:28:25 -0700
commitb174aa37b6a99461dc581c63a93a1d706705dd16 (patch)
tree90167be30ea92203dfc48564af5c408cbcd1e4bd /xfa/fwl/core/fwl_noteimp.cpp
parent590f2d9e057a0d5b17a9706affd3c6115265021b (diff)
downloadpdfium-b174aa37b6a99461dc581c63a93a1d706705dd16.tar.xz
Replace CFX_PtrArray with type-safe CFX_ArrayTemplate<>, Part 1.
Ideally, these will become std::vector<>, but in the mean time this is quicker and allow us to remove casts. Doing so has already turned up one place where the wrong type of object was being used. Review-Url: https://codereview.chromium.org/1924073002
Diffstat (limited to 'xfa/fwl/core/fwl_noteimp.cpp')
-rw-r--r--xfa/fwl/core/fwl_noteimp.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/xfa/fwl/core/fwl_noteimp.cpp b/xfa/fwl/core/fwl_noteimp.cpp
index b2e7440761..5cd643a81b 100644
--- a/xfa/fwl/core/fwl_noteimp.cpp
+++ b/xfa/fwl/core/fwl_noteimp.cpp
@@ -698,25 +698,26 @@ FX_BOOL CFWL_NoteDriver::IsValidMessage(CFWL_Message* pMessage) {
IFWL_Widget* CFWL_NoteDriver::GetMessageForm(IFWL_Widget* pDstTarget) {
int32_t iTrackLoop = m_noteLoopQueue.GetSize();
if (iTrackLoop <= 0)
- return NULL;
- IFWL_Widget* pMessageForm = NULL;
+ return nullptr;
+ IFWL_Widget* pMessageForm = nullptr;
if (iTrackLoop > 1) {
CFWL_NoteLoop* pNootLoop =
static_cast<CFWL_NoteLoop*>(m_noteLoopQueue[iTrackLoop - 1]);
pMessageForm = pNootLoop->GetForm()->GetInterface();
- } else {
- pMessageForm = (m_forms.Find(pDstTarget) < 0) ? NULL : pDstTarget;
+ } else if (m_forms.Find(pDstTarget->GetImpl()) < 0) {
+ pMessageForm = pDstTarget;
}
if (!pMessageForm && pDstTarget) {
CFWL_WidgetMgr* pWidgetMgr =
static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr());
if (!pWidgetMgr)
- return NULL;
+ return nullptr;
pMessageForm =
pWidgetMgr->GetWidget(pDstTarget, FWL_WGTRELATION_SystemForm);
}
return pMessageForm;
}
+
void CFWL_NoteDriver::ClearInvalidEventTargets(FX_BOOL bRemoveAll) {
FX_POSITION pos = m_eventTargets.GetStartPosition();
while (pos) {