From 540c436dc8e7d7b700b448acc8536f5cf68d4b74 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 24 Nov 2015 13:33:57 -0800 Subject: XFA: more underlying type changes to match master R=thestig@chromium.org Review URL: https://codereview.chromium.org/1474663004 . --- fpdfsdk/src/fpdfview.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'fpdfsdk/src/fpdfview.cpp') diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp index 7e568062f0..1ff1004880 100644 --- a/fpdfsdk/src/fpdfview.cpp +++ b/fpdfsdk/src/fpdfview.cpp @@ -873,8 +873,8 @@ DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, int page_index, double* width, double* height) { - CPDFXFA_Document* pDoc = (CPDFXFA_Document*)document; - if (pDoc == NULL) + UnderlyingDocumentType* pDoc = UnderlyingFromFPDFDocument(document); + if (!pDoc) return FALSE; int count = pDoc->GetPageCount(); @@ -1021,13 +1021,17 @@ DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDest(FPDF_DOCUMENT document, long* buflen) { if (!buffer) *buflen = 0; - if (!document || index < 0) - return NULL; + + if (index < 0) + return nullptr; CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); + if (!pDoc) + return nullptr; + CPDF_Dictionary* pRoot = pDoc->GetRoot(); if (!pRoot) - return NULL; + return nullptr; CPDF_Object* pDestObj = NULL; CFX_ByteString bsName; -- cgit v1.2.3