summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_formfillenvironment.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-04-24 20:54:41 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-24 20:54:41 +0000
commita1d344230925e94bbf43a62ddc814321056c68d5 (patch)
tree521550993794bc12ae4927529a780d72f89e5283 /fpdfsdk/cpdfsdk_formfillenvironment.cpp
parentb242943f5e949ce3d92dcb62c7497815ccd231d1 (diff)
downloadpdfium-a1d344230925e94bbf43a62ddc814321056c68d5.tar.xz
Fix include order for cpdfxfa_context.hchromium/3407
It should include cpdfsdk_helpers, not the other way around. Change-Id: Id2cc3018e8c38f82ce8a35b03bb90e936aa1d446 Reviewed-on: https://pdfium-review.googlesource.com/31294 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/cpdfsdk_formfillenvironment.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_formfillenvironment.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.cpp b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
index 272e27032b..a115355d9c 100644
--- a/fpdfsdk/cpdfsdk_formfillenvironment.cpp
+++ b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
@@ -20,6 +20,10 @@
#include "fxjs/ijs_runtime.h"
#include "third_party/base/ptr_util.h"
+#ifdef PDF_ENABLE_XFA
+#include "fpdfsdk/fpdfxfa/cpdfxfa_context.h"
+#endif
+
FPDF_WIDESTRING AsFPDFWideString(ByteString* bsUTF16LE) {
// Force a private version of the string, since we're about to hand it off
// to the embedder. Should the embedder modify it by accident, it won't
@@ -704,6 +708,16 @@ bool CPDFSDK_FormFillEnvironment::KillFocusAnnot(uint32_t nFlag) {
return !m_pFocusAnnot;
}
+#ifdef PDF_ENABLE_XFA
+CPDF_Document* CPDFSDK_FormFillEnvironment::GetPDFDocument() const {
+ return m_pUnderlyingDoc ? m_pUnderlyingDoc->GetPDFDoc() : nullptr;
+}
+#endif // PDF_ENABLE_XFA
+
+int CPDFSDK_FormFillEnvironment::GetPageCount() const {
+ return m_pUnderlyingDoc->GetPageCount();
+}
+
bool CPDFSDK_FormFillEnvironment::GetPermissions(int nFlag) const {
return !!(GetPDFDocument()->GetUserPermissions() & nFlag);
}