From 2b11dc1220746d2f6f97a940fc9e4235c8ed4975 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 22 Oct 2015 15:02:06 -0400 Subject: 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 . --- fpdfsdk/src/fpdfview.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'fpdfsdk/src/fpdfview.cpp') 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(); -- cgit v1.2.3