OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |