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

Unified Diff: core/src/fpdfdoc/doc_bookmark.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: core/src/fpdfdoc/doc_bookmark.cpp
diff --git a/core/src/fpdfdoc/doc_bookmark.cpp b/core/src/fpdfdoc/doc_bookmark.cpp
index 6b020e5957a3a99dd9c0c4edc1a439c656cd3b68..5ebd27e6e720dfbff40b1201f19c2730dce25f52 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 {

Powered by Google App Engine
This is Rietveld 408576698