diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-11-20 21:19:13 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-11-20 21:19:13 +0000 |
commit | 2501ae2474c1f097a06634d647de2eb3fb730864 (patch) | |
tree | 3ac7d386a3e73f3c848c203c3f0e61af9d284c1f /xfa/fxfa/cxfa_ffwidgethandler.cpp | |
parent | 89453e92d5d0b7aaf9e0c3890a90a21adc94a0ce (diff) | |
download | pdfium-2501ae2474c1f097a06634d647de2eb3fb730864.tar.xz |
Remove CXFA_DataData operator bool override
This CL removes CXFA_DataData::operator bool in favour of an explicit
HasValidNode method. This makes the call sites a lot clearer.
Change-Id: I6fae14fdeec4674ca7916e21b9e5703070fc3069
Reviewed-on: https://pdfium-review.googlesource.com/18830
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_ffwidgethandler.cpp')
-rw-r--r-- | xfa/fxfa/cxfa_ffwidgethandler.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/xfa/fxfa/cxfa_ffwidgethandler.cpp b/xfa/fxfa/cxfa_ffwidgethandler.cpp index f1b8f76e87..89fed79ec8 100644 --- a/xfa/fxfa/cxfa_ffwidgethandler.cpp +++ b/xfa/fxfa/cxfa_ffwidgethandler.cpp @@ -190,11 +190,12 @@ bool CXFA_FFWidgetHandler::HasEvent(CXFA_WidgetAcc* pWidgetAcc, switch (eEventType) { case XFA_EVENT_Calculate: { CXFA_CalculateData calcData = pWidgetAcc->GetCalculateData(); - return calcData && calcData.GetScriptData(); + return calcData.HasValidNode() && calcData.GetScriptData().HasValidNode(); } case XFA_EVENT_Validate: { CXFA_ValidateData validateData = pWidgetAcc->GetValidateData(false); - return validateData && validateData.GetScriptData(); + return validateData.HasValidNode() && + validateData.GetScriptData().HasValidNode(); } default: break; @@ -221,7 +222,7 @@ int32_t CXFA_FFWidgetHandler::ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, return XFA_EVENTERROR_Disabled; case XFA_EVENT_InitCalculate: { CXFA_CalculateData calcData = pWidgetAcc->GetCalculateData(); - if (!calcData) + if (!calcData.HasValidNode()) return XFA_EVENTERROR_NotExist; if (pWidgetAcc->GetNode()->IsUserInteractive()) return XFA_EVENTERROR_Disabled; |