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

Side by Side Diff: core/src/fpdfdoc/doc_bookmark.cpp

Issue 984143002: Merge to XFA: Make conversion between CPDF_Dest and its object explicit. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « core/src/fpdfdoc/doc_action.cpp ('k') | core/src/fpdfdoc/doc_link.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "../../include/fpdfdoc/fpdf_doc.h" 7 #include "../../include/fpdfdoc/fpdf_doc.h"
8 CPDF_Bookmark CPDF_BookmarkTree::GetFirstChild(const CPDF_Bookmark& parent) cons t 8 CPDF_Bookmark CPDF_BookmarkTree::GetFirstChild(const CPDF_Bookmark& parent) cons t
9 { 9 {
10 if (!parent.m_pDict) { 10 if (!parent.m_pDict) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 if (buf[i] < 0x20) { 61 if (buf[i] < 0x20) {
62 buf[i] = 0x20; 62 buf[i] = 0x20;
63 } 63 }
64 } 64 }
65 title.ReleaseBuffer(len); 65 title.ReleaseBuffer(len);
66 return title; 66 return title;
67 } 67 }
68 CPDF_Dest CPDF_Bookmark::GetDest(CPDF_Document* pDocument) const 68 CPDF_Dest CPDF_Bookmark::GetDest(CPDF_Document* pDocument) const
69 { 69 {
70 if (!m_pDict) { 70 if (!m_pDict) {
71 return NULL; 71 return CPDF_Dest();
72 } 72 }
73 CPDF_Object* pDest = m_pDict->GetElementValue("Dest"); 73 CPDF_Object* pDest = m_pDict->GetElementValue("Dest");
74 if (!pDest) { 74 if (!pDest) {
75 return NULL; 75 return CPDF_Dest();
76 } 76 }
77 if (pDest->GetType() == PDFOBJ_STRING || pDest->GetType() == PDFOBJ_NAME) { 77 if (pDest->GetType() == PDFOBJ_STRING || pDest->GetType() == PDFOBJ_NAME) {
78 CPDF_NameTree name_tree(pDocument, FX_BSTRC("Dests")); 78 CPDF_NameTree name_tree(pDocument, FX_BSTRC("Dests"));
79 CFX_ByteStringC name = pDest->GetString(); 79 CFX_ByteStringC name = pDest->GetString();
80 return name_tree.LookupNamedDest(pDocument, name); 80 return CPDF_Dest(name_tree.LookupNamedDest(pDocument, name));
81 } else if (pDest->GetType() == PDFOBJ_ARRAY) {
82 return (CPDF_Array*)pDest;
83 } 81 }
84 return NULL; 82 if (pDest->GetType() == PDFOBJ_ARRAY) {
83 return CPDF_Dest((CPDF_Array*)pDest);
84 }
85 return CPDF_Dest();
85 } 86 }
86 CPDF_Action CPDF_Bookmark::GetAction() const 87 CPDF_Action CPDF_Bookmark::GetAction() const
87 { 88 {
88 if (!m_pDict) { 89 if (!m_pDict) {
89 return CPDF_Action(); 90 return CPDF_Action();
90 } 91 }
91 return CPDF_Action(m_pDict->GetDict("A")); 92 return CPDF_Action(m_pDict->GetDict("A"));
92 } 93 }
OLDNEW
« no previous file with comments | « core/src/fpdfdoc/doc_action.cpp ('k') | core/src/fpdfdoc/doc_link.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698