From 1b2462846b5deee5b142251cbe2bb7d7c07df41b Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Wed, 25 Nov 2015 15:15:31 -0800 Subject: XFA: More underlying types Precursor to https://codereview.chromium.org/1477583002/ Also: whitespace in fxjs_v8.h Merge where possible. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1472363003 . --- fpdfsdk/src/fpdfformfill.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'fpdfsdk/src/fpdfformfill.cpp') diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp index 5dcfb47890..0798c4e190 100644 --- a/fpdfsdk/src/fpdfformfill.cpp +++ b/fpdfsdk/src/fpdfformfill.cpp @@ -269,13 +269,17 @@ DLLEXPORT void STDCALL FPDF_FFLDraw(FPDF_FORMHANDLE hHandle, int size_y, int rotate, int flags) { - if (!hHandle || !page) + if (!hHandle) + return; + + UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page); + if (!pPage) return; - CPDFXFA_Page* pPage = (CPDFXFA_Page*)page; CPDFXFA_Document* pDocument = pPage->GetDocument(); if (!pDocument) return; + CPDF_Document* pPDFDoc = pDocument->GetPDFDoc(); if (!pPDFDoc) return; @@ -321,7 +325,7 @@ DLLEXPORT void STDCALL FPDF_FFLDraw(FPDF_FORMHANDLE hHandle, options.m_AddFlags = flags >> 8; options.m_pOCContext = new CPDF_OCContext(pPDFDoc); - if (CPDFSDK_PageView* pPageView = pFXDoc->GetPageView((CPDFXFA_Page*)page)) + if (CPDFSDK_PageView* pPageView = pFXDoc->GetPageView(pPage)) pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options, clip); pDevice->RestoreState(); -- cgit v1.2.3