diff options
author | Tom Sepez <tsepez@chromium.org> | 2017-03-14 12:13:22 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-03-14 19:59:49 +0000 |
commit | f8a943908a414836271a1b7d7e4a97635d941b7f (patch) | |
tree | 7f900d57e21c72a67a0347e4f25d0784bdad7c83 /xfa/fxfa/app/xfa_ffwidgethandler.cpp | |
parent | 05df075154a832fcb476e1dfcfb865722d0ea898 (diff) | |
download | pdfium-f8a943908a414836271a1b7d7e4a97635d941b7f.tar.xz |
Replace CXFA_{Object,Node}Array with std::vector
These two ought to happen at the same time as they are
intertwined in spots. Remove blatant casts between the
two along the way.
Change-Id: I9ce5d2faadf1e38aba7cade316560d24a66d8669
Reviewed-on: https://pdfium-review.googlesource.com/2933
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/app/xfa_ffwidgethandler.cpp')
-rw-r--r-- | xfa/fxfa/app/xfa_ffwidgethandler.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/xfa/fxfa/app/xfa_ffwidgethandler.cpp b/xfa/fxfa/app/xfa_ffwidgethandler.cpp index dc3850c778..8ecc4565e1 100644 --- a/xfa/fxfa/app/xfa_ffwidgethandler.cpp +++ b/xfa/fxfa/app/xfa_ffwidgethandler.cpp @@ -164,34 +164,25 @@ void CXFA_FFWidgetHandler::RenderWidget(CXFA_FFWidget* hWidget, bool CXFA_FFWidgetHandler::HasEvent(CXFA_WidgetAcc* pWidgetAcc, XFA_EVENTTYPE eEventType) { - if (!pWidgetAcc || eEventType == XFA_EVENT_Unknown) + if (eEventType == XFA_EVENT_Unknown) return false; - if (pWidgetAcc->GetElementType() == XFA_Element::Draw) + + if (!pWidgetAcc || pWidgetAcc->GetElementType() == XFA_Element::Draw) return false; switch (eEventType) { case XFA_EVENT_Calculate: { CXFA_Calculate calc = pWidgetAcc->GetCalculate(); - if (!calc) - return false; - if (calc.GetScript()) - return true; - return false; + return calc && calc.GetScript(); } case XFA_EVENT_Validate: { CXFA_Validate val = pWidgetAcc->GetValidate(); - if (!val) - return false; - if (val.GetScript()) - return true; - return false; + return val && val.GetScript(); } default: break; } - CXFA_NodeArray eventArray; - return pWidgetAcc->GetEventByActivity(gs_EventActivity[eEventType], - eventArray) > 0; + return !pWidgetAcc->GetEventByActivity(gs_EventActivity[eEventType]).empty(); } int32_t CXFA_FFWidgetHandler::ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, |