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 "core/include/fpdfapi/fpdf_page.h" | 7 #include "core/include/fpdfapi/fpdf_page.h" |
8 #include "core/include/fpdfapi/fpdf_parser.h" | 8 #include "core/include/fpdfapi/fpdf_parser.h" |
9 #include "core/include/fpdfdoc/fpdf_tagged.h" | 9 #include "core/include/fpdfdoc/fpdf_tagged.h" |
10 #include "tagged_int.h" | 10 #include "core/src/fpdfdoc/tagged_int.h" |
11 | 11 |
12 const int nMaxRecursion = 32; | 12 const int nMaxRecursion = 32; |
13 static FX_BOOL IsTagged(const CPDF_Document* pDoc) { | 13 static FX_BOOL IsTagged(const CPDF_Document* pDoc) { |
14 CPDF_Dictionary* pCatalog = pDoc->GetRoot(); | 14 CPDF_Dictionary* pCatalog = pDoc->GetRoot(); |
15 CPDF_Dictionary* pMarkInfo = pCatalog->GetDictBy("MarkInfo"); | 15 CPDF_Dictionary* pMarkInfo = pCatalog->GetDictBy("MarkInfo"); |
16 return pMarkInfo != NULL && pMarkInfo->GetIntegerBy("Marked"); | 16 return pMarkInfo != NULL && pMarkInfo->GetIntegerBy("Marked"); |
17 } | 17 } |
18 CPDF_StructTree* CPDF_StructTree::LoadPage(const CPDF_Document* pDoc, | 18 CPDF_StructTree* CPDF_StructTree::LoadPage(const CPDF_Document* pDoc, |
19 const CPDF_Dictionary* pPageDict) { | 19 const CPDF_Dictionary* pPageDict) { |
20 if (!IsTagged(pDoc)) { | 20 if (!IsTagged(pDoc)) { |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 return ToNumber(pAttr) ? pAttr->GetNumber() : default_value; | 425 return ToNumber(pAttr) ? pAttr->GetNumber() : default_value; |
426 } | 426 } |
427 int CPDF_StructElementImpl::GetInteger(const CFX_ByteStringC& owner, | 427 int CPDF_StructElementImpl::GetInteger(const CFX_ByteStringC& owner, |
428 const CFX_ByteStringC& name, | 428 const CFX_ByteStringC& name, |
429 int default_value, | 429 int default_value, |
430 FX_BOOL bInheritable, | 430 FX_BOOL bInheritable, |
431 int subindex) { | 431 int subindex) { |
432 CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex); | 432 CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex); |
433 return ToNumber(pAttr) ? pAttr->GetInteger() : default_value; | 433 return ToNumber(pAttr) ? pAttr->GetInteger() : default_value; |
434 } | 434 } |
OLD | NEW |