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

Unified Diff: fpdfsdk/src/fpdfview.cpp

Issue 1474663004: XFA: more underlying type changes to match master (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 1 month 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
Index: fpdfsdk/src/fpdfview.cpp
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index 7e568062f008a866dc1f0bf0f2deb9168b56dae8..1ff100488085b9335326eeeb099cd7d3dad5240b 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -873,8 +873,8 @@ DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document,
int page_index,
double* width,
double* height) {
- CPDFXFA_Document* pDoc = (CPDFXFA_Document*)document;
- if (pDoc == NULL)
+ UnderlyingDocumentType* pDoc = UnderlyingFromFPDFDocument(document);
+ if (!pDoc)
return FALSE;
int count = pDoc->GetPageCount();
@@ -1021,13 +1021,17 @@ DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDest(FPDF_DOCUMENT document,
long* buflen) {
if (!buffer)
*buflen = 0;
- if (!document || index < 0)
- return NULL;
+
+ if (index < 0)
+ return nullptr;
CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document);
+ if (!pDoc)
+ return nullptr;
+
CPDF_Dictionary* pRoot = pDoc->GetRoot();
if (!pRoot)
- return NULL;
+ return nullptr;
CPDF_Object* pDestObj = NULL;
CFX_ByteString bsName;

Powered by Google App Engine
This is Rietveld 408576698