From bb51c4fb6bc6095984c303c95e5336f83e66bc67 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Wed, 14 Oct 2015 16:34:46 -0700 Subject: Introduce CPDF_Document::FromFPDFDocument(). This will be used to abstract one major difference between master and XFA, namely that the CPDF_Document is not a direct cast in XFA. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1395493007 . --- fpdfsdk/src/fpdf_dataavail.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fpdfsdk/src/fpdf_dataavail.cpp') diff --git a/fpdfsdk/src/fpdf_dataavail.cpp b/fpdfsdk/src/fpdf_dataavail.cpp index 5343723476..3944f67b03 100644 --- a/fpdfsdk/src/fpdf_dataavail.cpp +++ b/fpdfsdk/src/fpdf_dataavail.cpp @@ -115,9 +115,9 @@ FPDFAvail_GetDocument(FPDF_AVAIL avail, FPDF_BYTESTRING password) { } DLLEXPORT int STDCALL FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc) { - if (doc == NULL) + CPDF_Document* pDoc = CPDF_Document::FromFPDFDocument(doc); + if (!doc) return 0; - CPDF_Document* pDoc = (CPDF_Document*)doc; return ((CPDF_Parser*)pDoc->GetParser())->GetFirstPageNo(); } -- cgit v1.2.3