summaryrefslogtreecommitdiff
path: root/fpdfsdk/src
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-11-24 09:22:01 -0800
committerTom Sepez <tsepez@chromium.org>2015-11-24 09:22:01 -0800
commita2167107bbcef6a3e3687d49a5b1e62503391316 (patch)
treec63995427c467f01cd6f10d80c5afcdb34f2245c /fpdfsdk/src
parenta96043b4d16446042733c3b381ad62eb267b4890 (diff)
downloadpdfium-a2167107bbcef6a3e3687d49a5b1e62503391316.tar.xz
Fix wrong page count returned in FPDF_GetPageCount() for dynamic XFA files
In FPDF_GetPageCount(), 'document' is converted to a non-XFA document pointer (CPDF_Document*). So it only returns non-XFA or static XFA page count. If XFA files include dynamic XFA fields on some pages, the returned value doesn't reflect these pages. BUG=pdfium:278 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1442753005 .
Diffstat (limited to 'fpdfsdk/src')
-rw-r--r--fpdfsdk/src/fpdfview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index 8da56dc3b6..8b3dff2fba 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -416,7 +416,7 @@ DLLEXPORT int STDCALL FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document) {
}
DLLEXPORT int STDCALL FPDF_GetPageCount(FPDF_DOCUMENT document) {
- CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document);
+ CPDFXFA_Document* pDoc = static_cast<CPDFXFA_Document*>(document);
return pDoc ? pDoc->GetPageCount() : 0;
}