summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdf_dataavail.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-10-15 16:17:18 -0700
committerTom Sepez <tsepez@chromium.org>2015-10-15 16:17:18 -0700
commit471a1034e70ddcfc93ce2a93b28a8385109e83de (patch)
treec845fb1b73b936023be1fc2e7699ff4768aec652 /fpdfsdk/src/fpdf_dataavail.cpp
parentdfbf8e7ba55695c4e6cb30eadbe9c6a2955815ba (diff)
downloadpdfium-471a1034e70ddcfc93ce2a93b28a8385109e83de.tar.xz
Merge to XFA: Introduce CPDF_DocumentFromFPDFDocument().
Manual merges everywhere. Original Review URL: https://codereview.chromium.org/1395493007 . (cherry picked from commit bb51c4fb6bc6095984c303c95e5336f83e66bc67) Original Review URL: https://codereview.chromium.org/1396283006 . (cherry picked from commit 86adb658843658969041a13bf6cf0cc950ffe8ed) R=thestig@chromium.org Review URL: https://codereview.chromium.org/1395353004 .
Diffstat (limited to 'fpdfsdk/src/fpdf_dataavail.cpp')
-rw-r--r--fpdfsdk/src/fpdf_dataavail.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/fpdfsdk/src/fpdf_dataavail.cpp b/fpdfsdk/src/fpdf_dataavail.cpp
index d3b44160a8..f09b173208 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,