summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-11 18:29:53 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-11 18:29:53 +0000
commit9398e8b365416e07c6c31485c9ecf9674e2c71b4 (patch)
tree6967fbccad4d025f810c3bef412bfd623cf7bc31 /xfa/fxfa/parser
parent5c818b62f4b17ea18f4fc5805ba11e1936e6bc62 (diff)
downloadpdfium-9398e8b365416e07c6c31485c9ecf9674e2c71b4.tar.xz
Rename CXFA_Event methods
This CL renames CXFA_Event methods for clarity and fixes callers where needed. Change-Id: I902a35f36ee91c1b4aadd10382d93988ef26dc1c Reviewed-on: https://pdfium-review.googlesource.com/22750 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser')
-rw-r--r--xfa/fxfa/parser/cxfa_event.cpp4
-rw-r--r--xfa/fxfa/parser/cxfa_event.h4
-rw-r--r--xfa/fxfa/parser/cxfa_node.cpp10
3 files changed, 11 insertions, 7 deletions
diff --git a/xfa/fxfa/parser/cxfa_event.cpp b/xfa/fxfa/parser/cxfa_event.cpp
index 9eef655d31..d4af2fff8e 100644
--- a/xfa/fxfa/parser/cxfa_event.cpp
+++ b/xfa/fxfa/parser/cxfa_event.cpp
@@ -69,10 +69,10 @@ WideString CXFA_Event::GetRef() {
return JSObject()->GetCData(XFA_Attribute::Ref);
}
-CXFA_Script* CXFA_Event::GetScript() {
+CXFA_Script* CXFA_Event::GetScriptIfExists() {
return GetChild<CXFA_Script>(0, XFA_Element::Script, false);
}
-CXFA_Submit* CXFA_Event::GetSubmit() {
+CXFA_Submit* CXFA_Event::GetSubmitIfExists() {
return GetChild<CXFA_Submit>(0, XFA_Element::Submit, false);
}
diff --git a/xfa/fxfa/parser/cxfa_event.h b/xfa/fxfa/parser/cxfa_event.h
index a2b2fb804a..a410805675 100644
--- a/xfa/fxfa/parser/cxfa_event.h
+++ b/xfa/fxfa/parser/cxfa_event.h
@@ -19,8 +19,8 @@ class CXFA_Event : public CXFA_Node {
XFA_AttributeEnum GetActivity();
XFA_Element GetEventType() const;
- CXFA_Script* GetScript();
- CXFA_Submit* GetSubmit();
+ CXFA_Script* GetScriptIfExists();
+ CXFA_Submit* GetSubmitIfExists();
WideString GetRef();
};
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index e6cdf98d49..3f0eb2bb34 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -1690,12 +1690,16 @@ int32_t CXFA_Node::ProcessEvent(CXFA_FFDocView* docView,
case XFA_Element::Execute:
break;
case XFA_Element::Script:
- return ExecuteScript(docView, event->GetScript(), pEventParam);
+ return ExecuteScript(docView, event->GetScriptIfExists(), pEventParam);
case XFA_Element::SignData:
break;
- case XFA_Element::Submit:
+ case XFA_Element::Submit: {
+ CXFA_Submit* submit = event->GetSubmitIfExists();
+ if (!submit)
+ return XFA_EVENTERROR_NotExist;
return docView->GetDoc()->GetDocEnvironment()->Submit(docView->GetDoc(),
- event->GetSubmit());
+ submit);
+ }
default:
break;
}