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_ext.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'fpdfsdk/src/fpdf_ext.cpp') diff --git a/fpdfsdk/src/fpdf_ext.cpp b/fpdfsdk/src/fpdf_ext.cpp index 2d84ff2a50..1cc1829914 100644 --- a/fpdfsdk/src/fpdf_ext.cpp +++ b/fpdfsdk/src/fpdf_ext.cpp @@ -183,10 +183,11 @@ void CheckUnSupportError(CPDF_Document* pDoc, FX_DWORD err_code) { } DLLEXPORT int FPDFDoc_GetPageMode(FPDF_DOCUMENT document) { - if (!document) + CPDF_Document* pDoc = CPDF_Document::FromFPDFDocument(document); + if (!pDoc) return PAGEMODE_UNKNOWN; - CPDF_Dictionary* pRoot = ((CPDF_Document*)document)->GetRoot(); + CPDF_Dictionary* pRoot = pDoc->GetRoot(); if (!pRoot) return PAGEMODE_UNKNOWN; -- cgit v1.2.3