summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-12-14 20:20:33 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-14 20:20:33 +0000
commitc5e0f66f5f2e0645f2beab70b44690fe510a9f2d (patch)
treef8e2c82f055a43a1f19f16228a97302439a80f9a /fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
parent2eeb42b74b1d29b3cf7fb7344530137debb680dd (diff)
downloadpdfium-c5e0f66f5f2e0645f2beab70b44690fe510a9f2d.tar.xz
Fold CXFA_SubmitData into CXFA_Submit
CXFA_SubmitData is a thin wrapper around CXFA_Submit. This CL folds the two classes together. Change-Id: I867b6db067786d232df2a25c1ba7b29d6d454f8e Reviewed-on: https://pdfium-review.googlesource.com/21190 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp')
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
index fdf0d31ea2..071fe34bdd 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
@@ -22,6 +22,7 @@
#include "xfa/fxfa/cxfa_ffwidget.h"
#include "xfa/fxfa/cxfa_ffwidgethandler.h"
#include "xfa/fxfa/cxfa_widgetacciterator.h"
+#include "xfa/fxfa/parser/cxfa_submit.h"
#define IDS_XFA_Validate_Input \
"At least one required field was empty. Please fill in the required " \
@@ -684,13 +685,12 @@ void CPDFXFA_DocEnvironment::OnAfterNotifySubmit() {
m_pContext->GetXFADocView()->UpdateDocView();
}
-bool CPDFXFA_DocEnvironment::SubmitData(CXFA_FFDoc* hDoc,
- CXFA_SubmitData submitData) {
+bool CPDFXFA_DocEnvironment::Submit(CXFA_FFDoc* hDoc, CXFA_Submit* submit) {
if (!NotifySubmit(true) || !m_pContext->GetXFADocView())
return false;
m_pContext->GetXFADocView()->UpdateDocView();
- bool ret = SubmitDataInternal(hDoc, submitData);
+ bool ret = SubmitInternal(hDoc, submit);
NotifySubmit(false);
return ret;
}
@@ -893,13 +893,13 @@ bool CPDFXFA_DocEnvironment::MailToInfo(WideString& csURL,
return true;
}
-bool CPDFXFA_DocEnvironment::SubmitDataInternal(CXFA_FFDoc* hDoc,
- CXFA_SubmitData submitData) {
+bool CPDFXFA_DocEnvironment::SubmitInternal(CXFA_FFDoc* hDoc,
+ CXFA_Submit* submit) {
CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pContext->GetFormFillEnv();
if (!pFormFillEnv)
return false;
- WideString csURL = submitData.GetSubmitTarget();
+ WideString csURL = submit->GetSubmitTarget();
if (csURL.IsEmpty()) {
WideString ws = WideString::FromLocal("Submit cancelled.");
ByteString bs = ws.UTF16LE_Encode();
@@ -912,15 +912,15 @@ bool CPDFXFA_DocEnvironment::SubmitDataInternal(CXFA_FFDoc* hDoc,
FPDF_FILEHANDLER* pFileHandler = nullptr;
int fileFlag = -1;
- switch (submitData.GetSubmitFormat()) {
+ switch (submit->GetSubmitFormat()) {
case XFA_AttributeEnum::Xdp: {
- WideString csContent = submitData.GetSubmitXDPContent();
+ WideString csContent = submit->GetSubmitXDPContent();
csContent.Trim();
WideString space = WideString::FromLocal(" ");
csContent = space + csContent + space;
FPDF_DWORD flag = 0;
- if (submitData.IsSubmitEmbedPDF())
+ if (submit->IsSubmitEmbedPDF())
flag |= FXFA_PDF;
ToXFAContentFlags(csContent, flag);