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

Side by Side Diff: core/fpdfdoc/doc_tagged.cpp

Issue 1867183002: Use std::vector as internal storage for CPDF_Array (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 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 <map> 7 #include <map>
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_dictionary.h" 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 if (CPDF_Dictionary* pDict = pKids->AsDictionary()) { 63 if (CPDF_Dictionary* pDict = pKids->AsDictionary()) {
64 CPDF_StructElementImpl* pStructElementImpl = 64 CPDF_StructElementImpl* pStructElementImpl =
65 new CPDF_StructElementImpl(this, nullptr, pDict); 65 new CPDF_StructElementImpl(this, nullptr, pDict);
66 m_Kids.Add(pStructElementImpl); 66 m_Kids.Add(pStructElementImpl);
67 return; 67 return;
68 } 68 }
69 CPDF_Array* pArray = pKids->AsArray(); 69 CPDF_Array* pArray = pKids->AsArray();
70 if (!pArray) 70 if (!pArray)
71 return; 71 return;
72 72
73 for (uint32_t i = 0; i < pArray->GetCount(); i++) { 73 for (size_t i = 0; i < pArray->GetCount(); i++) {
74 CPDF_Dictionary* pKid = pArray->GetDictAt(i); 74 CPDF_Dictionary* pKid = pArray->GetDictAt(i);
75 CPDF_StructElementImpl* pStructElementImpl = 75 CPDF_StructElementImpl* pStructElementImpl =
76 new CPDF_StructElementImpl(this, nullptr, pKid); 76 new CPDF_StructElementImpl(this, nullptr, pKid);
77 m_Kids.Add(pStructElementImpl); 77 m_Kids.Add(pStructElementImpl);
78 } 78 }
79 } 79 }
80 void CPDF_StructTreeImpl::LoadPageTree(const CPDF_Dictionary* pPageDict) { 80 void CPDF_StructTreeImpl::LoadPageTree(const CPDF_Dictionary* pPageDict) {
81 m_pPage = pPageDict; 81 m_pPage = pPageDict;
82 if (!m_pTreeRoot) 82 if (!m_pTreeRoot)
83 return; 83 return;
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 return ToNumber(pAttr) ? pAttr->GetNumber() : default_value; 434 return ToNumber(pAttr) ? pAttr->GetNumber() : default_value;
435 } 435 }
436 int CPDF_StructElementImpl::GetInteger(const CFX_ByteStringC& owner, 436 int CPDF_StructElementImpl::GetInteger(const CFX_ByteStringC& owner,
437 const CFX_ByteStringC& name, 437 const CFX_ByteStringC& name,
438 int default_value, 438 int default_value,
439 FX_BOOL bInheritable, 439 FX_BOOL bInheritable,
440 int subindex) { 440 int subindex) {
441 CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex); 441 CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex);
442 return ToNumber(pAttr) ? pAttr->GetInteger() : default_value; 442 return ToNumber(pAttr) ? pAttr->GetInteger() : default_value;
443 } 443 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698