summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_ffnotify.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-06 21:14:41 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-06 21:14:41 +0000
commit55b0b5ab342c86485e321f76f04f3f1fffeafae2 (patch)
treeaaa6ca93e8bbdf6c7614921af418f6aefbd959eb /xfa/fxfa/cxfa_ffnotify.cpp
parent898690313426bf1604e0bb6def684db84a782494 (diff)
downloadpdfium-55b0b5ab342c86485e321f76f04f3f1fffeafae2.tar.xz
Cleanup CXFA_WidgetAcc
This CL cleans up some CXFA_WidgetAcc methods and hides the need for a CFXJSE_Value inside the class. The API which required the Value always used it to retrieve a boolean value, so make a new API which returns the bool. Change-Id: Ic50a9a73c992a9db8b57ce5f9f5ac17c88267809 Reviewed-on: https://pdfium-review.googlesource.com/17853 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_ffnotify.cpp')
-rw-r--r--xfa/fxfa/cxfa_ffnotify.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/xfa/fxfa/cxfa_ffnotify.cpp b/xfa/fxfa/cxfa_ffnotify.cpp
index df28aac0c1..3cad913d0a 100644
--- a/xfa/fxfa/cxfa_ffnotify.cpp
+++ b/xfa/fxfa/cxfa_ffnotify.cpp
@@ -6,7 +6,6 @@
#include "xfa/fxfa/cxfa_ffnotify.h"
-#include "fxjs/cfxjse_value.h"
#include "xfa/fxfa/cxfa_ffapp.h"
#include "xfa/fxfa/cxfa_ffarc.h"
#include "xfa/fxfa/cxfa_ffbarcode.h"
@@ -208,25 +207,22 @@ bool CXFA_FFNotify::FindSplitPos(CXFA_Node* pItem,
}
bool CXFA_FFNotify::RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem) {
- bool bRet = false;
CXFA_FFDocView* pDocView = m_pDoc->GetDocView();
if (!pDocView)
- return bRet;
+ return false;
CXFA_WidgetAcc* pWidgetAcc = ToWidgetAcc(pFormItem->GetWidgetData());
if (!pWidgetAcc)
- return bRet;
+ return false;
CXFA_EventParam EventParam;
EventParam.m_eType = XFA_EVENT_Unknown;
- CFXJSE_Value* pRetValue = nullptr;
- int32_t iRet =
- pWidgetAcc->ExecuteScript(CXFA_Script(pScript), &EventParam, &pRetValue);
- if (iRet == XFA_EVENTERROR_Success && pRetValue) {
- bRet = pRetValue->ToBoolean();
- delete pRetValue;
- }
- return bRet;
+
+ int32_t iRet;
+ bool bRet;
+ std::tie(iRet, bRet) =
+ pWidgetAcc->ExecuteBoolScript(CXFA_Script(pScript), &EventParam);
+ return iRet == XFA_EVENTERROR_Success && bRet;
}
int32_t CXFA_FFNotify::ExecEventByDeepFirst(CXFA_Node* pFormNode,