Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Unified Diff: fpdfsdk/src/fpdf_progressive.cpp

Issue 1411623002: Merge to XFA: Introduce CPDFPageFromFPFDPage() (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Stray file. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/src/fpdf_flatten.cpp ('k') | fpdfsdk/src/fpdf_transformpage.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdf_progressive.cpp
diff --git a/fpdfsdk/src/fpdf_progressive.cpp b/fpdfsdk/src/fpdf_progressive.cpp
index f5e11e8c811cf9f182d3446ed40bed383eff7fd2..4412648c8cc1b7a78d2f336196b3e76abe74deff 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;
« no previous file with comments | « fpdfsdk/src/fpdf_flatten.cpp ('k') | fpdfsdk/src/fpdf_transformpage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698