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

Unified Diff: fpdfsdk/src/fpdfview.cpp

Issue 1419643005: Merge to XFA: Add type cast definitions for CPDF_Array. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: 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
Index: fpdfsdk/src/fpdfview.cpp
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index bd7741d1e8e2598ba5f8370f319f13149d57f628..b3c8137d0c17396e9a423fdef610adbd7ae58a92 100644
--- a/fpdfsdk/src/fpdfview.cpp
+++ b/fpdfsdk/src/fpdfview.cpp
@@ -1041,14 +1041,15 @@ DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDest(FPDF_DOCUMENT document,
pDestObj = nameTree.LookupValue(index, bsName);
}
if (!pDestObj)
- return NULL;
+ return nullptr;
if (CPDF_Dictionary* pDict = pDestObj->AsDictionary()) {
pDestObj = pDict->GetArray(FX_BSTRC("D"));
if (!pDestObj)
- return NULL;
+ return nullptr;
}
- if (pDestObj->GetType() != PDFOBJ_ARRAY)
- return NULL;
+ if (!pDestObj->IsArray())
+ return nullptr;
+
CFX_WideString wsName = PDF_DecodeText(bsName);
CFX_ByteString utf16Name = wsName.UTF16LE_Encode();
unsigned int len = utf16Name.GetLength();

Powered by Google App Engine
This is Rietveld 408576698