diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-10-16 14:00:21 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-10-16 14:00:21 -0700 |
commit | db0be96179f0cd5f1787564cbccf86320a4d54ae (patch) | |
tree | 447ba797f172bfffa2d21dacc7dbf6fb2900bfd7 /fpdfsdk/src/fpdf_progressive.cpp | |
parent | cebdda5a686251087f14e8df19b7f988dfae46de (diff) | |
download | pdfium-db0be96179f0cd5f1787564cbccf86320a4d54ae.tar.xz |
Merge to XFA: Introduce CPDFPageFromFPFDPage()
Original Review URL: https://codereview.chromium.org/1406543004 .
(cherry picked from commit 943ea142b6a7e6edc91fe3c307013129e6eb0ef3)
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1411623002 .
Diffstat (limited to 'fpdfsdk/src/fpdf_progressive.cpp')
-rw-r--r-- | fpdfsdk/src/fpdf_progressive.cpp | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/fpdfsdk/src/fpdf_progressive.cpp b/fpdfsdk/src/fpdf_progressive.cpp index f5e11e8c81..4412648c8c 100644 --- a/fpdfsdk/src/fpdf_progressive.cpp +++ b/fpdfsdk/src/fpdf_progressive.cpp @@ -20,16 +20,10 @@ DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start(FPDF_BITMAP bitmap, int rotate, int flags, IFSDK_PAUSE* pause) { - if (bitmap == NULL || page == NULL) + if (!bitmap || !pause || pause->version != 1) return FPDF_RENDER_FAILED; - if (!pause) - return FPDF_RENDER_FAILED; - - if (pause->version != 1) - return FPDF_RENDER_FAILED; - - CPDF_Page* pPage = ((CPDFXFA_Page*)page)->GetPDFPage(); + CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!pPage) return FPDF_RENDER_FAILED; @@ -66,16 +60,10 @@ DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start(FPDF_BITMAP bitmap, DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page, IFSDK_PAUSE* pause) { - if (page == NULL) + if (!pause || pause->version != 1) return FPDF_RENDER_FAILED; - if (!pause) - return FPDF_RENDER_FAILED; - - if (pause->version != 1) - return FPDF_RENDER_FAILED; - - CPDF_Page* pPage = ((CPDFXFA_Page*)page)->GetPDFPage(); + CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!pPage) return FPDF_RENDER_FAILED; @@ -93,9 +81,7 @@ DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page, } DLLEXPORT void STDCALL FPDF_RenderPage_Close(FPDF_PAGE page) { - if (!page) - return; - CPDF_Page* pPage = ((CPDFXFA_Page*)page)->GetPDFPage(); + CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!pPage) return; |