summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdf_ext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/fpdf_ext.cpp')
-rw-r--r--fpdfsdk/src/fpdf_ext.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/fpdfsdk/src/fpdf_ext.cpp b/fpdfsdk/src/fpdf_ext.cpp
index f68a45f119..196ac99967 100644
--- a/fpdfsdk/src/fpdf_ext.cpp
+++ b/fpdfsdk/src/fpdf_ext.cpp
@@ -177,11 +177,11 @@ void CheckUnSupportError(CPDF_Document* pDoc, FX_DWORD err_code) {
}
DLLEXPORT int FPDFDoc_GetPageMode(FPDF_DOCUMENT document) {
- if (!document)
+ CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document);
+ if (!pDoc)
return PAGEMODE_UNKNOWN;
- CPDF_Dictionary* pRoot =
- (((CPDFXFA_Document*)document)->GetPDFDoc())->GetRoot();
+ CPDF_Dictionary* pRoot = pDoc->GetRoot();
if (!pRoot)
return PAGEMODE_UNKNOWN;