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 #include "../../src/fxcrt/fx_safe_types.h" | 8 #include "../../src/fxcrt/fx_safe_types.h" |
9 | 9 |
10 CPDF_LinkList::~CPDF_LinkList() | 10 CPDF_LinkList::~CPDF_LinkList() |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 } | 83 } |
84 } | 84 } |
85 CPDF_Rect CPDF_Link::GetRect() | 85 CPDF_Rect CPDF_Link::GetRect() |
86 { | 86 { |
87 return m_pDict->GetRect("Rect"); | 87 return m_pDict->GetRect("Rect"); |
88 } | 88 } |
89 CPDF_Dest CPDF_Link::GetDest(CPDF_Document* pDoc) | 89 CPDF_Dest CPDF_Link::GetDest(CPDF_Document* pDoc) |
90 { | 90 { |
91 CPDF_Object* pDest = m_pDict->GetElementValue("Dest"); | 91 CPDF_Object* pDest = m_pDict->GetElementValue("Dest"); |
92 if (pDest == NULL) { | 92 if (pDest == NULL) { |
93 return NULL; | 93 return CPDF_Dest(); |
94 } | 94 } |
95 if (pDest->GetType() == PDFOBJ_STRING || pDest->GetType() == PDFOBJ_NAME) { | 95 if (pDest->GetType() == PDFOBJ_STRING || pDest->GetType() == PDFOBJ_NAME) { |
96 CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests")); | 96 CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests")); |
97 CFX_ByteStringC name = pDest->GetString(); | 97 CFX_ByteStringC name = pDest->GetString(); |
98 return name_tree.LookupNamedDest(pDoc, name); | 98 return CPDF_Dest(name_tree.LookupNamedDest(pDoc, name)); |
99 } else if (pDest->GetType() == PDFOBJ_ARRAY) { | |
100 return (CPDF_Array*)pDest; | |
101 } | 99 } |
102 return NULL; | 100 if (pDest->GetType() == PDFOBJ_ARRAY) { |
| 101 return CPDF_Dest((CPDF_Array*)pDest); |
| 102 } |
| 103 return CPDF_Dest(); |
103 } | 104 } |
104 CPDF_Action CPDF_Link::GetAction() | 105 CPDF_Action CPDF_Link::GetAction() |
105 { | 106 { |
106 return CPDF_Action(m_pDict->GetDict("A")); | 107 return CPDF_Action(m_pDict->GetDict("A")); |
107 } | 108 } |
OLD | NEW |