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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 CFX_ByteString type = m_pDict->GetStringBy("S"); | 31 CFX_ByteString type = m_pDict->GetStringBy("S"); |
32 if (type != "GoTo" && type != "GoToR") { | 32 if (type != "GoTo" && type != "GoToR") { |
33 return CPDF_Dest(); | 33 return CPDF_Dest(); |
34 } | 34 } |
35 CPDF_Object* pDest = m_pDict->GetDirectObjectBy("D"); | 35 CPDF_Object* pDest = m_pDict->GetDirectObjectBy("D"); |
36 if (!pDest) { | 36 if (!pDest) { |
37 return CPDF_Dest(); | 37 return CPDF_Dest(); |
38 } | 38 } |
39 if (pDest->IsString() || pDest->IsName()) { | 39 if (pDest->IsString() || pDest->IsName()) { |
40 CPDF_NameTree name_tree(pDoc, "Dests"); | 40 CPDF_NameTree name_tree(pDoc, "Dests"); |
41 return CPDF_Dest( | 41 return CPDF_Dest(name_tree.LookupNamedDest(pDoc, pDest->GetString())); |
42 name_tree.LookupNamedDest(pDoc, pDest->GetString().AsStringC())); | |
43 } | 42 } |
44 if (CPDF_Array* pArray = pDest->AsArray()) | 43 if (CPDF_Array* pArray = pDest->AsArray()) |
45 return CPDF_Dest(pArray); | 44 return CPDF_Dest(pArray); |
46 return CPDF_Dest(); | 45 return CPDF_Dest(); |
47 } | 46 } |
48 | 47 |
49 CPDF_Action::ActionType CPDF_Action::GetType() const { | 48 CPDF_Action::ActionType CPDF_Action::GetType() const { |
50 if (!m_pDict) | 49 if (!m_pDict) |
51 return Unknown; | 50 return Unknown; |
52 | 51 |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 if (!ToDictionary(pAction)) { | 293 if (!ToDictionary(pAction)) { |
295 return CPDF_Action(); | 294 return CPDF_Action(); |
296 } | 295 } |
297 return CPDF_Action(pAction->GetDict()); | 296 return CPDF_Action(pAction->GetDict()); |
298 } | 297 } |
299 int CPDF_DocJSActions::FindJSAction(const CFX_ByteString& csName) const { | 298 int CPDF_DocJSActions::FindJSAction(const CFX_ByteString& csName) const { |
300 ASSERT(m_pDocument); | 299 ASSERT(m_pDocument); |
301 CPDF_NameTree name_tree(m_pDocument, "JavaScript"); | 300 CPDF_NameTree name_tree(m_pDocument, "JavaScript"); |
302 return name_tree.GetIndex(csName); | 301 return name_tree.GetIndex(csName); |
303 } | 302 } |
OLD | NEW |