summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_formfillenvironment.cpp
diff options
context:
space:
mode:
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);
}