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" |
11 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 11 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
12 #include "core/fpdfapi/fpdf_parser/include/cpdf_reference.h" | 12 #include "core/fpdfapi/fpdf_parser/include/cpdf_reference.h" |
13 #include "core/fpdfdoc/doc_utils.h" | 13 #include "core/fpdfdoc/doc_utils.h" |
14 #include "core/fpdfdoc/tagged_int.h" | 14 #include "core/fpdfdoc/tagged_int.h" |
15 #include "core/include/fpdfapi/fpdf_page.h" | |
16 #include "core/include/fpdfdoc/fpdf_tagged.h" | 15 #include "core/include/fpdfdoc/fpdf_tagged.h" |
17 | 16 |
18 const int nMaxRecursion = 32; | 17 const int nMaxRecursion = 32; |
19 static FX_BOOL IsTagged(const CPDF_Document* pDoc) { | 18 static FX_BOOL IsTagged(const CPDF_Document* pDoc) { |
20 CPDF_Dictionary* pCatalog = pDoc->GetRoot(); | 19 CPDF_Dictionary* pCatalog = pDoc->GetRoot(); |
21 CPDF_Dictionary* pMarkInfo = pCatalog->GetDictBy("MarkInfo"); | 20 CPDF_Dictionary* pMarkInfo = pCatalog->GetDictBy("MarkInfo"); |
22 return pMarkInfo && pMarkInfo->GetIntegerBy("Marked"); | 21 return pMarkInfo && pMarkInfo->GetIntegerBy("Marked"); |
23 } | 22 } |
24 CPDF_StructTree* CPDF_StructTree::LoadPage(const CPDF_Document* pDoc, | 23 CPDF_StructTree* CPDF_StructTree::LoadPage(const CPDF_Document* pDoc, |
25 const CPDF_Dictionary* pPageDict) { | 24 const CPDF_Dictionary* pPageDict) { |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 return ToNumber(pAttr) ? pAttr->GetNumber() : default_value; | 430 return ToNumber(pAttr) ? pAttr->GetNumber() : default_value; |
432 } | 431 } |
433 int CPDF_StructElementImpl::GetInteger(const CFX_ByteStringC& owner, | 432 int CPDF_StructElementImpl::GetInteger(const CFX_ByteStringC& owner, |
434 const CFX_ByteStringC& name, | 433 const CFX_ByteStringC& name, |
435 int default_value, | 434 int default_value, |
436 FX_BOOL bInheritable, | 435 FX_BOOL bInheritable, |
437 int subindex) { | 436 int subindex) { |
438 CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex); | 437 CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex); |
439 return ToNumber(pAttr) ? pAttr->GetInteger() : default_value; | 438 return ToNumber(pAttr) ? pAttr->GetInteger() : default_value; |
440 } | 439 } |
OLD | NEW |