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

Unified Diff: fpdfsdk/src/fpdf_dataavail.cpp

Issue 1395353004: Merge to XFA: Introduce CPDFDocumentFromFPDFDocument(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Remove another pointless local var. 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/include/fsdk_define.h ('k') | fpdfsdk/src/fpdf_ext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdf_dataavail.cpp
diff --git a/fpdfsdk/src/fpdf_dataavail.cpp b/fpdfsdk/src/fpdf_dataavail.cpp
index d3b44160a8104898b88eb1545a0107371ffd9925..f09b173208e7d936c38087e8caedf1d660e17907 100644
--- a/fpdfsdk/src/fpdf_dataavail.cpp
+++ b/fpdfsdk/src/fpdf_dataavail.cpp
@@ -119,10 +119,8 @@ FPDFAvail_GetDocument(FPDF_AVAIL avail, FPDF_BYTESTRING password) {
}
DLLEXPORT int STDCALL FPDFAvail_GetFirstPageNum(FPDF_DOCUMENT doc) {
- if (doc == NULL)
- return 0;
- CPDF_Document* pDoc = ((CPDFXFA_Document*)doc)->GetPDFDoc();
- return ((CPDF_Parser*)pDoc->GetParser())->GetFirstPageNo();
+ CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(doc);
+ return pDoc ? pDoc->GetParser()->GetFirstPageNo() : 0;
}
DLLEXPORT int STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail,
« no previous file with comments | « fpdfsdk/include/fsdk_define.h ('k') | fpdfsdk/src/fpdf_ext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698