From a2167107bbcef6a3e3687d49a5b1e62503391316 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 24 Nov 2015 09:22:01 -0800 Subject: 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 . --- fpdfsdk/src/fpdfview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fpdfsdk/src/fpdfview.cpp') 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(document); return pDoc ? pDoc->GetPageCount() : 0; } -- cgit v1.2.3