summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfxfa
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-07-25 17:26:28 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-07-25 17:26:28 +0000
commit1b54bc1474af7923f6b82496924978cb87844ff0 (patch)
tree440ee4b9cbfabd526815e2d57dd5af19063ee6fc /fpdfsdk/fpdfxfa
parent96b0d1332430e34219334373aeb0f6a85eb8ad68 (diff)
downloadpdfium-1b54bc1474af7923f6b82496924978cb87844ff0.tar.xz
Disable submit in XFA forms.
Bug: chromium:842503 Change-Id: If411815d8324929f482e3cad0fda54f24d370c2a Reviewed-on: https://pdfium-review.googlesource.com/37830 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfxfa')
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp4
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h5
2 files changed, 9 insertions, 0 deletions
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
index 9d1ceacf02..269b6d4b2f 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
@@ -613,6 +613,7 @@ FX_ARGB CPDFXFA_DocEnvironment::GetHighlightColor(CXFA_FFDoc* hDoc) {
pInterForm->GetHighlightColor(FormFieldType::kXFA));
}
+#ifdef PDF_XFA_ELEMENT_SUBMIT_ENABLED
bool CPDFXFA_DocEnvironment::NotifySubmit(bool bPrevOrPost) {
if (bPrevOrPost)
return OnBeforeNotifySubmit();
@@ -702,6 +703,7 @@ bool CPDFXFA_DocEnvironment::Submit(CXFA_FFDoc* hDoc, CXFA_Submit* submit) {
NotifySubmit(false);
return ret;
}
+#endif // PDF_XFA_ELEMENT_SUBMIT_ENABLED
RetainPtr<IFX_SeekableReadStream> CPDFXFA_DocEnvironment::OpenLinkedFile(
CXFA_FFDoc* hDoc,
@@ -901,6 +903,7 @@ bool CPDFXFA_DocEnvironment::MailToInfo(WideString& csURL,
return true;
}
+#ifdef PDF_XFA_ELEMENT_SUBMIT_ENABLED
bool CPDFXFA_DocEnvironment::SubmitInternal(CXFA_FFDoc* hDoc,
CXFA_Submit* submit) {
CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pContext->GetFormFillEnv();
@@ -978,6 +981,7 @@ bool CPDFXFA_DocEnvironment::SubmitInternal(CXFA_FFDoc* hDoc,
pFormFillEnv->UploadTo(pFileHandler, fileFlag, AsFPDFWideString(&bs));
return true;
}
+#endif // PDF_XFA_ELEMENT_SUBMIT_ENABLED
bool CPDFXFA_DocEnvironment::SetPropertyInNonXFAGlobalObject(
CXFA_FFDoc* hDoc,
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h
index 1c46a37fe8..33e04ed376 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h
@@ -62,7 +62,9 @@ class CPDFXFA_DocEnvironment : public IXFA_DocEnvironment {
uint32_t dwOptions) override;
FX_ARGB GetHighlightColor(CXFA_FFDoc* hDoc) override;
+#ifdef PDF_XFA_ELEMENT_SUBMIT_ENABLED
bool Submit(CXFA_FFDoc* hDoc, CXFA_Submit* submit) override;
+#endif // PDF_XFA_ELEMENT_SUBMIT_ENABLED
bool GetPropertyFromNonXFAGlobalObject(CXFA_FFDoc* hDoc,
const ByteStringView& szPropName,
@@ -76,10 +78,13 @@ class CPDFXFA_DocEnvironment : public IXFA_DocEnvironment {
const WideString& wsLink) override;
private:
+#ifdef PDF_XFA_ELEMENT_SUBMIT_ENABLED
bool OnBeforeNotifySubmit();
void OnAfterNotifySubmit();
bool NotifySubmit(bool bPrevOrPost);
bool SubmitInternal(CXFA_FFDoc* hDoc, CXFA_Submit* submit);
+#endif // PDF_XFA_ELEMENT_SUBMIT_ENABLED
+
bool MailToInfo(WideString& csURL,
WideString& csToAddress,
WideString& csCCAddress,