summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_ffwidgethandler.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-08 17:00:20 -0500
committerChromium commit bot <commit-bot@chromium.org>2018-01-09 15:39:17 +0000
commit9dfcdd24a599a1a2439b80e3910a2ac366fb445b (patch)
treecd97ad15cb6ac57b87ac00562251e219e71e0b6e /xfa/fxfa/cxfa_ffwidgethandler.cpp
parent133542fbe7c01dd296d6ffd205281702ad914506 (diff)
downloadpdfium-9dfcdd24a599a1a2439b80e3910a2ac366fb445b.tar.xz
Move Process* methods to CXFA_Node
This CL moves the CXFA_WidgetAcc::Process* methods to CXFA_Node. Change-Id: Ic01b62e3786a6666a698f8877a8b7b295714bf79 Reviewed-on: https://pdfium-review.googlesource.com/22472 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_ffwidgethandler.cpp')
-rw-r--r--xfa/fxfa/cxfa_ffwidgethandler.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/xfa/fxfa/cxfa_ffwidgethandler.cpp b/xfa/fxfa/cxfa_ffwidgethandler.cpp
index 454627dacb..c1e00fb668 100644
--- a/xfa/fxfa/cxfa_ffwidgethandler.cpp
+++ b/xfa/fxfa/cxfa_ffwidgethandler.cpp
@@ -185,20 +185,20 @@ bool CXFA_FFWidgetHandler::HasEvent(CXFA_WidgetAcc* pWidgetAcc,
XFA_EVENTTYPE eEventType) {
if (eEventType == XFA_EVENT_Unknown)
return false;
+ if (!pWidgetAcc)
+ return false;
- if (!pWidgetAcc ||
- (pWidgetAcc->GetNode() &&
- pWidgetAcc->GetNode()->GetElementType() == XFA_Element::Draw)) {
+ CXFA_Node* node = pWidgetAcc->GetNode();
+ if (!node || node->GetElementType() == XFA_Element::Draw)
return false;
- }
switch (eEventType) {
case XFA_EVENT_Calculate: {
- CXFA_Calculate* calc = pWidgetAcc->GetNode()->GetCalculate();
+ CXFA_Calculate* calc = node->GetCalculate();
return calc && calc->GetScript();
}
case XFA_EVENT_Validate: {
- CXFA_Validate* validate = pWidgetAcc->GetNode()->GetValidate(false);
+ CXFA_Validate* validate = node->GetValidate(false);
return validate && validate->GetScript();
}
default:
@@ -212,19 +212,20 @@ int32_t CXFA_FFWidgetHandler::ProcessEvent(CXFA_WidgetAcc* pWidgetAcc,
CXFA_EventParam* pParam) {
if (!pParam || pParam->m_eType == XFA_EVENT_Unknown)
return XFA_EVENTERROR_NotExist;
- if (!pWidgetAcc ||
- (pWidgetAcc->GetNode() &&
- pWidgetAcc->GetNode()->GetElementType() == XFA_Element::Draw)) {
+ if (!pWidgetAcc)
+ return XFA_EVENTERROR_NotExist;
+
+ CXFA_Node* node = pWidgetAcc->GetNode();
+ if (!node || node->GetElementType() == XFA_Element::Draw)
return XFA_EVENTERROR_NotExist;
- }
switch (pParam->m_eType) {
case XFA_EVENT_Calculate:
- return pWidgetAcc->ProcessCalculate(m_pDocView);
+ return node->ProcessCalculate(m_pDocView);
case XFA_EVENT_Validate:
if (m_pDocView->GetDoc()->GetDocEnvironment()->IsValidationsEnabled(
m_pDocView->GetDoc())) {
- return pWidgetAcc->ProcessValidate(m_pDocView, 0);
+ return node->ProcessValidate(m_pDocView, 0);
}
return XFA_EVENTERROR_Disabled;
case XFA_EVENT_InitCalculate: {
@@ -238,8 +239,8 @@ int32_t CXFA_FFWidgetHandler::ProcessEvent(CXFA_WidgetAcc* pWidgetAcc,
default:
break;
}
- int32_t iRet = pWidgetAcc->ProcessEvent(
- m_pDocView, gs_EventActivity[pParam->m_eType], pParam);
+ int32_t iRet =
+ node->ProcessEvent(m_pDocView, gs_EventActivity[pParam->m_eType], pParam);
return iRet;
}