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