diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2015-10-22 09:31:44 -0400 |
---|---|---|
committer | Dan Sinclair <dsinclair@chromium.org> | 2015-10-22 09:31:44 -0400 |
commit | c2bfc000e502c42c9a3017038fd9104c7997d126 (patch) | |
tree | a693dd82199e7af83fac7b7b19d023e4c5fc5e36 /fpdfsdk/src/fpdfview.cpp | |
parent | 69ceb6a9761b3ccb228a2405e9a493a3666e0601 (diff) | |
download | pdfium-c2bfc000e502c42c9a3017038fd9104c7997d126.tar.xz |
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 .
Diffstat (limited to 'fpdfsdk/src/fpdfview.cpp')
-rw-r--r-- | fpdfsdk/src/fpdfview.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp index c8c2c73c9a..97da89e296 100644 --- a/fpdfsdk/src/fpdfview.cpp +++ b/fpdfsdk/src/fpdfview.cpp @@ -885,14 +885,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(); |