summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfformfill.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/fpdfformfill.cpp')
-rw-r--r--fpdfsdk/src/fpdfformfill.cpp10
1 files changed, 7 insertions, 3 deletions
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();