diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2015-10-22 15:02:06 -0400 |
---|---|---|
committer | Dan Sinclair <dsinclair@chromium.org> | 2015-10-22 15:02:06 -0400 |
commit | 2b11dc1220746d2f6f97a940fc9e4235c8ed4975 (patch) | |
tree | e25b2ba13112f4ead789260ee57fe5b40c13b83e /core/src/fpdfdoc/doc_bookmark.cpp | |
parent | bc6c6723c37772b02de9e6e43fa0fd9439874905 (diff) | |
download | pdfium-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 'core/src/fpdfdoc/doc_bookmark.cpp')
-rw-r--r-- | core/src/fpdfdoc/doc_bookmark.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/core/src/fpdfdoc/doc_bookmark.cpp b/core/src/fpdfdoc/doc_bookmark.cpp index 6b020e5957..5ebd27e6e7 100644 --- a/core/src/fpdfdoc/doc_bookmark.cpp +++ b/core/src/fpdfdoc/doc_bookmark.cpp @@ -68,21 +68,19 @@ CFX_WideString CPDF_Bookmark::GetTitle() const { return CFX_WideString(buf.get(), len); } CPDF_Dest CPDF_Bookmark::GetDest(CPDF_Document* pDocument) const { - if (!m_pDict) { + if (!m_pDict) return CPDF_Dest(); - } + CPDF_Object* pDest = m_pDict->GetElementValue("Dest"); if (!pDest) return CPDF_Dest(); - if (pDest->IsString() || pDest->IsName()) { CPDF_NameTree name_tree(pDocument, FX_BSTRC("Dests")); CFX_ByteStringC name = pDest->GetString(); return CPDF_Dest(name_tree.LookupNamedDest(pDocument, name)); } - if (pDest->GetType() == PDFOBJ_ARRAY) { - return CPDF_Dest((CPDF_Array*)pDest); - } + if (CPDF_Array* pArray = pDest->AsArray()) + return CPDF_Dest(pArray); return CPDF_Dest(); } CPDF_Action CPDF_Bookmark::GetAction() const { |