summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfview.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2015-10-22 15:02:06 -0400
committerDan Sinclair <dsinclair@chromium.org>2015-10-22 15:02:06 -0400
commit2b11dc1220746d2f6f97a940fc9e4235c8ed4975 (patch)
treee25b2ba13112f4ead789260ee57fe5b40c13b83e /fpdfsdk/src/fpdfview.cpp
parentbc6c6723c37772b02de9e6e43fa0fd9439874905 (diff)
downloadpdfium-2b11dc1220746d2f6f97a940fc9e4235c8ed4975.tar.xz
Merge to XFA: Add type cast definitions for CPDF_Array.
This Cl adds ToArray, CPDF_Object::AsArray and CPDF_Object::IsArray and updates the src to use them as needed. BUG=pdfium:201 R=thestig@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1417893003 . (cherry picked from commit c2bfc000e502c42c9a3017038fd9104c7997d126) Review URL: https://codereview.chromium.org/1419643005 .
Diffstat (limited to 'fpdfsdk/src/fpdfview.cpp')
-rw-r--r--fpdfsdk/src/fpdfview.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index bd7741d1e8..b3c8137d0c 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();