summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_widgetacc.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-03 17:25:02 -0500
committerChromium commit bot <commit-bot@chromium.org>2018-01-04 16:02:33 +0000
commita0af75cc4d1e50bb2832dc58636043afe565b02b (patch)
tree7474018a95fbefc318e3316074cc982910e9036f /xfa/fxfa/cxfa_widgetacc.cpp
parent4cf0589c4bc388781cbfc8459c4904bb2bd947bf (diff)
downloadpdfium-a0af75cc4d1e50bb2832dc58636043afe565b02b.tar.xz
Fold CXFA_EventData into CXFA_Event
This CL removes the CXFA_EventData wrapper and puts the code into CXFA_Event. Change-Id: I799a641c434ff926f3ddade1f47845b5666dbbec Reviewed-on: https://pdfium-review.googlesource.com/21991 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_widgetacc.cpp')
-rw-r--r--xfa/fxfa/cxfa_widgetacc.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/xfa/fxfa/cxfa_widgetacc.cpp b/xfa/fxfa/cxfa_widgetacc.cpp
index a811d37fa4..83d3869bdc 100644
--- a/xfa/fxfa/cxfa_widgetacc.cpp
+++ b/xfa/fxfa/cxfa_widgetacc.cpp
@@ -23,6 +23,7 @@
#include "xfa/fxfa/cxfa_textprovider.h"
#include "xfa/fxfa/parser/cxfa_calculate.h"
#include "xfa/fxfa/parser/cxfa_caption.h"
+#include "xfa/fxfa/parser/cxfa_event.h"
#include "xfa/fxfa/parser/cxfa_font.h"
#include "xfa/fxfa/parser/cxfa_image.h"
#include "xfa/fxfa/parser/cxfa_items.h"
@@ -293,12 +294,12 @@ int32_t CXFA_WidgetAcc::ProcessEvent(XFA_AttributeEnum iActivity,
if (GetElementType() == XFA_Element::Draw)
return XFA_EVENTERROR_NotExist;
- std::vector<CXFA_Node*> eventArray =
+ std::vector<CXFA_Event*> eventArray =
GetEventByActivity(iActivity, pEventParam->m_bIsFormReady);
bool first = true;
int32_t iRet = XFA_EVENTERROR_NotExist;
- for (CXFA_Node* pNode : eventArray) {
- int32_t result = ProcessEvent(CXFA_EventData(pNode), pEventParam);
+ for (CXFA_Event* event : eventArray) {
+ int32_t result = ProcessEvent(event, pEventParam);
if (first || result == XFA_EVENTERROR_Success)
iRet = result;
first = false;
@@ -306,21 +307,21 @@ int32_t CXFA_WidgetAcc::ProcessEvent(XFA_AttributeEnum iActivity,
return iRet;
}
-int32_t CXFA_WidgetAcc::ProcessEvent(const CXFA_EventData& eventData,
+int32_t CXFA_WidgetAcc::ProcessEvent(CXFA_Event* event,
CXFA_EventParam* pEventParam) {
- if (!eventData.HasValidNode())
+ if (!event)
return XFA_EVENTERROR_NotExist;
- switch (eventData.GetEventType()) {
+ switch (event->GetEventType()) {
case XFA_Element::Execute:
break;
case XFA_Element::Script:
- return ExecuteScript(eventData.GetScript(), pEventParam);
+ return ExecuteScript(event->GetScript(), pEventParam);
case XFA_Element::SignData:
break;
case XFA_Element::Submit:
return GetDoc()->GetDocEnvironment()->Submit(GetDoc(),
- eventData.GetSubmit());
+ event->GetSubmit());
default:
break;
}