summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fxfa/cxfa_widgetacc.cpp4
-rw-r--r--xfa/fxfa/fxfa.h3
-rw-r--r--xfa/fxfa/parser/cxfa_eventdata.cpp6
-rw-r--r--xfa/fxfa/parser/cxfa_eventdata.h4
-rw-r--r--xfa/fxfa/parser/cxfa_submit.cpp16
-rw-r--r--xfa/fxfa/parser/cxfa_submit.h6
-rw-r--r--xfa/fxfa/parser/cxfa_submitdata.cpp27
-rw-r--r--xfa/fxfa/parser/cxfa_submitdata.h26
8 files changed, 32 insertions, 60 deletions
diff --git a/xfa/fxfa/cxfa_widgetacc.cpp b/xfa/fxfa/cxfa_widgetacc.cpp
index f8ea037bf3..755821ef6b 100644
--- a/xfa/fxfa/cxfa_widgetacc.cpp
+++ b/xfa/fxfa/cxfa_widgetacc.cpp
@@ -311,8 +311,8 @@ int32_t CXFA_WidgetAcc::ProcessEvent(const CXFA_EventData& eventData,
case XFA_Element::SignData:
break;
case XFA_Element::Submit:
- return GetDoc()->GetDocEnvironment()->SubmitData(
- GetDoc(), eventData.GetSubmitData());
+ return GetDoc()->GetDocEnvironment()->Submit(GetDoc(),
+ eventData.GetSubmit());
default:
break;
}
diff --git a/xfa/fxfa/fxfa.h b/xfa/fxfa/fxfa.h
index c81a9c2b5f..d7c8c651ca 100644
--- a/xfa/fxfa/fxfa.h
+++ b/xfa/fxfa/fxfa.h
@@ -14,6 +14,7 @@
#include "xfa/fxfa/fxfa_basic.h"
class CXFA_FFPageView;
+class CXFA_Submit;
class CXFA_WidgetAcc;
class IFWL_AdapterTimerMgr;
class IFX_SeekableReadStream;
@@ -248,7 +249,7 @@ class IXFA_DocEnvironment {
uint32_t dwOptions) = 0;
virtual FX_ARGB GetHighlightColor(CXFA_FFDoc* hDoc) = 0;
- virtual bool SubmitData(CXFA_FFDoc* hDoc, CXFA_SubmitData submitData) = 0;
+ virtual bool Submit(CXFA_FFDoc* hDoc, CXFA_Submit* submit) = 0;
virtual bool GetGlobalProperty(CXFA_FFDoc* hDoc,
const ByteStringView& szPropName,
CFXJSE_Value* pValue) = 0;
diff --git a/xfa/fxfa/parser/cxfa_eventdata.cpp b/xfa/fxfa/parser/cxfa_eventdata.cpp
index 0250346d85..062d881cda 100644
--- a/xfa/fxfa/parser/cxfa_eventdata.cpp
+++ b/xfa/fxfa/parser/cxfa_eventdata.cpp
@@ -7,6 +7,7 @@
#include "xfa/fxfa/parser/cxfa_eventdata.h"
#include "xfa/fxfa/parser/cxfa_node.h"
+#include "xfa/fxfa/parser/cxfa_submit.h"
CXFA_EventData::CXFA_EventData(CXFA_Node* pNode) : CXFA_DataData(pNode) {}
@@ -34,6 +35,7 @@ CXFA_ScriptData CXFA_EventData::GetScriptData() const {
return CXFA_ScriptData(m_pNode->GetChild(0, XFA_Element::Script, false));
}
-CXFA_SubmitData CXFA_EventData::GetSubmitData() const {
- return CXFA_SubmitData(m_pNode->GetChild(0, XFA_Element::Submit, false));
+CXFA_Submit* CXFA_EventData::GetSubmit() const {
+ return static_cast<CXFA_Submit*>(
+ m_pNode->GetChild(0, XFA_Element::Submit, false));
}
diff --git a/xfa/fxfa/parser/cxfa_eventdata.h b/xfa/fxfa/parser/cxfa_eventdata.h
index 4e386430dc..63349690ab 100644
--- a/xfa/fxfa/parser/cxfa_eventdata.h
+++ b/xfa/fxfa/parser/cxfa_eventdata.h
@@ -12,9 +12,9 @@
#include "core/fxcrt/fx_string.h"
#include "xfa/fxfa/parser/cxfa_datadata.h"
#include "xfa/fxfa/parser/cxfa_scriptdata.h"
-#include "xfa/fxfa/parser/cxfa_submitdata.h"
class CXFA_Node;
+class CXFA_Submit;
class CXFA_EventData : public CXFA_DataData {
public:
@@ -23,7 +23,7 @@ class CXFA_EventData : public CXFA_DataData {
XFA_AttributeEnum GetActivity();
XFA_Element GetEventType() const;
CXFA_ScriptData GetScriptData() const;
- CXFA_SubmitData GetSubmitData() const;
+ CXFA_Submit* GetSubmit() const;
WideString GetRef() const;
};
diff --git a/xfa/fxfa/parser/cxfa_submit.cpp b/xfa/fxfa/parser/cxfa_submit.cpp
index 04255f8dc5..e4558e865a 100644
--- a/xfa/fxfa/parser/cxfa_submit.cpp
+++ b/xfa/fxfa/parser/cxfa_submit.cpp
@@ -41,3 +41,19 @@ CXFA_Submit::CXFA_Submit(CXFA_Document* doc, XFA_PacketType packet)
pdfium::MakeUnique<CJX_Submit>(this)) {}
CXFA_Submit::~CXFA_Submit() {}
+
+bool CXFA_Submit::IsSubmitEmbedPDF() {
+ return JSObject()->GetBoolean(XFA_Attribute::EmbedPDF);
+}
+
+XFA_AttributeEnum CXFA_Submit::GetSubmitFormat() {
+ return JSObject()->GetEnum(XFA_Attribute::Format);
+}
+
+WideString CXFA_Submit::GetSubmitTarget() {
+ return JSObject()->GetCData(XFA_Attribute::Target);
+}
+
+WideString CXFA_Submit::GetSubmitXDPContent() {
+ return JSObject()->GetCData(XFA_Attribute::XdpContent);
+}
diff --git a/xfa/fxfa/parser/cxfa_submit.h b/xfa/fxfa/parser/cxfa_submit.h
index 2b9b5e8c69..24d5f11796 100644
--- a/xfa/fxfa/parser/cxfa_submit.h
+++ b/xfa/fxfa/parser/cxfa_submit.h
@@ -7,12 +7,18 @@
#ifndef XFA_FXFA_PARSER_CXFA_SUBMIT_H_
#define XFA_FXFA_PARSER_CXFA_SUBMIT_H_
+#include "core/fxcrt/widestring.h"
#include "xfa/fxfa/parser/cxfa_node.h"
class CXFA_Submit : public CXFA_Node {
public:
CXFA_Submit(CXFA_Document* doc, XFA_PacketType packet);
~CXFA_Submit() override;
+
+ bool IsSubmitEmbedPDF();
+ XFA_AttributeEnum GetSubmitFormat();
+ WideString GetSubmitTarget();
+ WideString GetSubmitXDPContent();
};
#endif // XFA_FXFA_PARSER_CXFA_SUBMIT_H_
diff --git a/xfa/fxfa/parser/cxfa_submitdata.cpp b/xfa/fxfa/parser/cxfa_submitdata.cpp
deleted file mode 100644
index 20dce38652..0000000000
--- a/xfa/fxfa/parser/cxfa_submitdata.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fxfa/parser/cxfa_submitdata.h"
-
-#include "xfa/fxfa/parser/cxfa_node.h"
-
-CXFA_SubmitData::CXFA_SubmitData(CXFA_Node* pNode) : CXFA_DataData(pNode) {}
-
-bool CXFA_SubmitData::IsSubmitEmbedPDF() const {
- return m_pNode->JSObject()->GetBoolean(XFA_Attribute::EmbedPDF);
-}
-
-XFA_AttributeEnum CXFA_SubmitData::GetSubmitFormat() const {
- return m_pNode->JSObject()->GetEnum(XFA_Attribute::Format);
-}
-
-WideString CXFA_SubmitData::GetSubmitTarget() const {
- return m_pNode->JSObject()->GetCData(XFA_Attribute::Target);
-}
-
-WideString CXFA_SubmitData::GetSubmitXDPContent() const {
- return m_pNode->JSObject()->GetCData(XFA_Attribute::XdpContent);
-}
diff --git a/xfa/fxfa/parser/cxfa_submitdata.h b/xfa/fxfa/parser/cxfa_submitdata.h
deleted file mode 100644
index 55f06f945a..0000000000
--- a/xfa/fxfa/parser/cxfa_submitdata.h
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FXFA_PARSER_CXFA_SUBMITDATA_H_
-#define XFA_FXFA_PARSER_CXFA_SUBMITDATA_H_
-
-#include "core/fxcrt/fx_string.h"
-#include "core/fxcrt/fx_system.h"
-#include "xfa/fxfa/parser/cxfa_datadata.h"
-
-class CXFA_Node;
-
-class CXFA_SubmitData : public CXFA_DataData {
- public:
- explicit CXFA_SubmitData(CXFA_Node* pNode);
-
- bool IsSubmitEmbedPDF() const;
- XFA_AttributeEnum GetSubmitFormat() const;
- WideString GetSubmitTarget() const;
- WideString GetSubmitXDPContent() const;
-};
-
-#endif // XFA_FXFA_PARSER_CXFA_SUBMITDATA_H_