| 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/cpdf_array.h" | 9 #include "core/fpdfapi/fpdf_parser/cpdf_array.h" |
| 10 #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" | 10 #include "core/fpdfapi/fpdf_parser/cpdf_dictionary.h" |
| 11 #include "core/fpdfapi/fpdf_parser/cpdf_document.h" | 11 #include "core/fpdfapi/fpdf_parser/cpdf_document.h" |
| 12 #include "core/fpdfapi/fpdf_parser/cpdf_reference.h" | 12 #include "core/fpdfapi/fpdf_parser/cpdf_reference.h" |
| 13 #include "core/fpdfapi/fpdf_parser/cpdf_stream.h" | 13 #include "core/fpdfapi/fpdf_parser/cpdf_stream.h" |
| 14 #include "core/fpdfdoc/cpdf_numbertree.h" | 14 #include "core/fpdfdoc/cpdf_numbertree.h" |
| 15 #include "core/fpdfdoc/include/fpdf_tagged.h" | 15 #include "core/fpdfdoc/fpdf_tagged.h" |
| 16 #include "core/fpdfdoc/tagged_int.h" | 16 #include "core/fpdfdoc/tagged_int.h" |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 const int nMaxRecursion = 32; | 20 const int nMaxRecursion = 32; |
| 21 | 21 |
| 22 bool IsTagged(const CPDF_Document* pDoc) { | 22 bool IsTagged(const CPDF_Document* pDoc) { |
| 23 CPDF_Dictionary* pCatalog = pDoc->GetRoot(); | 23 CPDF_Dictionary* pCatalog = pDoc->GetRoot(); |
| 24 CPDF_Dictionary* pMarkInfo = pCatalog->GetDictFor("MarkInfo"); | 24 CPDF_Dictionary* pMarkInfo = pCatalog->GetDictFor("MarkInfo"); |
| 25 return pMarkInfo && pMarkInfo->GetIntegerFor("Marked"); | 25 return pMarkInfo && pMarkInfo->GetIntegerFor("Marked"); |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 return ToNumber(pAttr) ? pAttr->GetNumber() : default_value; | 450 return ToNumber(pAttr) ? pAttr->GetNumber() : default_value; |
| 451 } | 451 } |
| 452 int CPDF_StructElementImpl::GetInteger(const CFX_ByteStringC& owner, | 452 int CPDF_StructElementImpl::GetInteger(const CFX_ByteStringC& owner, |
| 453 const CFX_ByteStringC& name, | 453 const CFX_ByteStringC& name, |
| 454 int default_value, | 454 int default_value, |
| 455 FX_BOOL bInheritable, | 455 FX_BOOL bInheritable, |
| 456 int subindex) { | 456 int subindex) { |
| 457 CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex); | 457 CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex); |
| 458 return ToNumber(pAttr) ? pAttr->GetInteger() : default_value; | 458 return ToNumber(pAttr) ? pAttr->GetInteger() : default_value; |
| 459 } | 459 } |
| OLD | NEW |