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.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.cpp b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
index 49a4a601d5..a0859a225a 100644
--- a/fpdfsdk/cpdfsdk_formfillenvironment.cpp
+++ b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
@@ -719,11 +719,8 @@ CPDFXFA_Context* CPDFSDK_FormFillEnvironment::GetXFAContext() const {
#endif // PDF_ENABLE_XFA
int CPDFSDK_FormFillEnvironment::GetPageCount() const {
-#ifdef PDF_ENABLE_XFA
- return GetXFAContext()->GetPageCount();
-#else
- return m_pCPDFDoc->GetPageCount();
-#endif
+ CPDF_Document::Extension* pExtension = m_pCPDFDoc->GetExtension();
+ return pExtension ? pExtension->GetPageCount() : m_pCPDFDoc->GetPageCount();
}
bool CPDFSDK_FormFillEnvironment::GetPermissions(int nFlag) const {