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

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

Issue 1194933003: Make CPDF_Object::GetString() a virtual method. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 5 years, 5 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
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 8
9 CPDF_LinkList::~CPDF_LinkList() 9 CPDF_LinkList::~CPDF_LinkList()
10 { 10 {
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 { 66 {
67 CPDF_Array* pAnnotList = pPage->m_pFormDict->GetArray("Annots"); 67 CPDF_Array* pAnnotList = pPage->m_pFormDict->GetArray("Annots");
68 if (pAnnotList == NULL) { 68 if (pAnnotList == NULL) {
69 return; 69 return;
70 } 70 }
71 for (FX_DWORD i = 0; i < pAnnotList->GetCount(); i ++) { 71 for (FX_DWORD i = 0; i < pAnnotList->GetCount(); i ++) {
72 CPDF_Dictionary* pAnnot = pAnnotList->GetDict(i); 72 CPDF_Dictionary* pAnnot = pAnnotList->GetDict(i);
73 if (pAnnot == NULL) { 73 if (pAnnot == NULL) {
74 continue; 74 continue;
75 } 75 }
76 if (pAnnot->GetString("Subtype") != "Link") { 76 if (pAnnot->GetStringAt("Subtype") != "Link") {
77 continue; 77 continue;
78 } 78 }
79 pList->Add(pAnnot); 79 pList->Add(pAnnot);
80 } 80 }
81 } 81 }
82 CPDF_Rect CPDF_Link::GetRect() 82 CPDF_Rect CPDF_Link::GetRect()
83 { 83 {
84 return m_pDict->GetRect("Rect"); 84 return m_pDict->GetRect("Rect");
85 } 85 }
86 CPDF_Dest CPDF_Link::GetDest(CPDF_Document* pDoc) 86 CPDF_Dest CPDF_Link::GetDest(CPDF_Document* pDoc)
87 { 87 {
88 CPDF_Object* pDest = m_pDict->GetElementValue("Dest"); 88 CPDF_Object* pDest = m_pDict->GetElementValue("Dest");
89 if (pDest == NULL) { 89 if (pDest == NULL) {
90 return CPDF_Dest(); 90 return CPDF_Dest();
91 } 91 }
92 if (pDest->GetType() == PDFOBJ_STRING || pDest->GetType() == PDFOBJ_NAME) { 92 if (pDest->GetType() == PDFOBJ_STRING || pDest->GetType() == PDFOBJ_NAME) {
93 CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests")); 93 CPDF_NameTree name_tree(pDoc, FX_BSTRC("Dests"));
94 CFX_ByteStringC name = pDest->GetString(); 94 CFX_ByteStringC name = pDest->GetString();
95 return CPDF_Dest(name_tree.LookupNamedDest(pDoc, name)); 95 return CPDF_Dest(name_tree.LookupNamedDest(pDoc, name));
96 } 96 }
97 if (pDest->GetType() == PDFOBJ_ARRAY) { 97 if (pDest->GetType() == PDFOBJ_ARRAY) {
98 return CPDF_Dest((CPDF_Array*)pDest); 98 return CPDF_Dest((CPDF_Array*)pDest);
99 } 99 }
100 return CPDF_Dest(); 100 return CPDF_Dest();
101 } 101 }
102 CPDF_Action CPDF_Link::GetAction() 102 CPDF_Action CPDF_Link::GetAction()
103 { 103 {
104 return CPDF_Action(m_pDict->GetDict("A")); 104 return CPDF_Action(m_pDict->GetDict("A"));
105 } 105 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698