| 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 "pageint.h" | 7 #include "pageint.h" |
| 8 | 8 |
| 9 #include "core/include/fpdfapi/fpdf_module.h" | 9 #include "core/include/fpdfapi/fpdf_module.h" |
| 10 #include "core/include/fpdfapi/fpdf_page.h" | 10 #include "core/include/fpdfapi/fpdf_page.h" |
| (...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 if (bottom > pObj->m_Bottom) { | 749 if (bottom > pObj->m_Bottom) { |
| 750 bottom = pObj->m_Bottom; | 750 bottom = pObj->m_Bottom; |
| 751 } | 751 } |
| 752 } | 752 } |
| 753 return CFX_FloatRect(left, bottom, right, top); | 753 return CFX_FloatRect(left, bottom, right, top); |
| 754 } | 754 } |
| 755 void CPDF_PageObjectList::LoadTransInfo() { | 755 void CPDF_PageObjectList::LoadTransInfo() { |
| 756 if (!m_pFormDict) { | 756 if (!m_pFormDict) { |
| 757 return; | 757 return; |
| 758 } | 758 } |
| 759 CPDF_Dictionary* pGroup = m_pFormDict->GetDict("Group"); | 759 CPDF_Dictionary* pGroup = m_pFormDict->GetDictBy("Group"); |
| 760 if (!pGroup) { | 760 if (!pGroup) { |
| 761 return; | 761 return; |
| 762 } | 762 } |
| 763 if (pGroup->GetString("S") != "Transparency") { | 763 if (pGroup->GetStringBy("S") != "Transparency") { |
| 764 return; | 764 return; |
| 765 } | 765 } |
| 766 m_Transparency |= PDFTRANS_GROUP; | 766 m_Transparency |= PDFTRANS_GROUP; |
| 767 if (pGroup->GetInteger("I")) { | 767 if (pGroup->GetIntegerBy("I")) { |
| 768 m_Transparency |= PDFTRANS_ISOLATED; | 768 m_Transparency |= PDFTRANS_ISOLATED; |
| 769 } | 769 } |
| 770 if (pGroup->GetInteger("K")) { | 770 if (pGroup->GetIntegerBy("K")) { |
| 771 m_Transparency |= PDFTRANS_KNOCKOUT; | 771 m_Transparency |= PDFTRANS_KNOCKOUT; |
| 772 } | 772 } |
| 773 } | 773 } |
| 774 | 774 |
| 775 CPDF_Page::CPDF_Page() : m_pPageRender(nullptr) {} | 775 CPDF_Page::CPDF_Page() : m_pPageRender(nullptr) {} |
| 776 | 776 |
| 777 void CPDF_Page::Load(CPDF_Document* pDocument, | 777 void CPDF_Page::Load(CPDF_Document* pDocument, |
| 778 CPDF_Dictionary* pPageDict, | 778 CPDF_Dictionary* pPageDict, |
| 779 FX_BOOL bPageCache) { | 779 FX_BOOL bPageCache) { |
| 780 m_pDocument = (CPDF_Document*)pDocument; | 780 m_pDocument = (CPDF_Document*)pDocument; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 } | 862 } |
| 863 } | 863 } |
| 864 CPDF_Object* FPDFAPI_GetPageAttr(CPDF_Dictionary* pPageDict, | 864 CPDF_Object* FPDFAPI_GetPageAttr(CPDF_Dictionary* pPageDict, |
| 865 const CFX_ByteStringC& name) { | 865 const CFX_ByteStringC& name) { |
| 866 int level = 0; | 866 int level = 0; |
| 867 while (1) { | 867 while (1) { |
| 868 CPDF_Object* pObj = pPageDict->GetElementValue(name); | 868 CPDF_Object* pObj = pPageDict->GetElementValue(name); |
| 869 if (pObj) { | 869 if (pObj) { |
| 870 return pObj; | 870 return pObj; |
| 871 } | 871 } |
| 872 CPDF_Dictionary* pParent = pPageDict->GetDict("Parent"); | 872 CPDF_Dictionary* pParent = pPageDict->GetDictBy("Parent"); |
| 873 if (!pParent || pParent == pPageDict) { | 873 if (!pParent || pParent == pPageDict) { |
| 874 return NULL; | 874 return NULL; |
| 875 } | 875 } |
| 876 pPageDict = pParent; | 876 pPageDict = pParent; |
| 877 level++; | 877 level++; |
| 878 if (level == 1000) { | 878 if (level == 1000) { |
| 879 return NULL; | 879 return NULL; |
| 880 } | 880 } |
| 881 } | 881 } |
| 882 } | 882 } |
| 883 CPDF_Object* CPDF_Page::GetPageAttr(const CFX_ByteStringC& name) const { | 883 CPDF_Object* CPDF_Page::GetPageAttr(const CFX_ByteStringC& name) const { |
| 884 return FPDFAPI_GetPageAttr(m_pFormDict, name); | 884 return FPDFAPI_GetPageAttr(m_pFormDict, name); |
| 885 } | 885 } |
| 886 CPDF_Form::CPDF_Form(CPDF_Document* pDoc, | 886 CPDF_Form::CPDF_Form(CPDF_Document* pDoc, |
| 887 CPDF_Dictionary* pPageResources, | 887 CPDF_Dictionary* pPageResources, |
| 888 CPDF_Stream* pFormStream, | 888 CPDF_Stream* pFormStream, |
| 889 CPDF_Dictionary* pParentResources) { | 889 CPDF_Dictionary* pParentResources) { |
| 890 m_pDocument = pDoc; | 890 m_pDocument = pDoc; |
| 891 m_pFormStream = pFormStream; | 891 m_pFormStream = pFormStream; |
| 892 m_pFormDict = pFormStream ? pFormStream->GetDict() : NULL; | 892 m_pFormDict = pFormStream ? pFormStream->GetDict() : NULL; |
| 893 m_pResources = m_pFormDict->GetDict("Resources"); | 893 m_pResources = m_pFormDict->GetDictBy("Resources"); |
| 894 m_pPageResources = pPageResources; | 894 m_pPageResources = pPageResources; |
| 895 if (!m_pResources) { | 895 if (!m_pResources) { |
| 896 m_pResources = pParentResources; | 896 m_pResources = pParentResources; |
| 897 } | 897 } |
| 898 if (!m_pResources) { | 898 if (!m_pResources) { |
| 899 m_pResources = pPageResources; | 899 m_pResources = pPageResources; |
| 900 } | 900 } |
| 901 m_Transparency = 0; | 901 m_Transparency = 0; |
| 902 LoadTransInfo(); | 902 LoadTransInfo(); |
| 903 } | 903 } |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 (FX_FLOAT)y0); | 986 (FX_FLOAT)y0); |
| 987 matrix = m_PageMatrix; | 987 matrix = m_PageMatrix; |
| 988 matrix.Concat(display_matrix); | 988 matrix.Concat(display_matrix); |
| 989 } | 989 } |
| 990 CPDF_ParseOptions::CPDF_ParseOptions() { | 990 CPDF_ParseOptions::CPDF_ParseOptions() { |
| 991 m_bTextOnly = FALSE; | 991 m_bTextOnly = FALSE; |
| 992 m_bMarkedContent = TRUE; | 992 m_bMarkedContent = TRUE; |
| 993 m_bSeparateForm = TRUE; | 993 m_bSeparateForm = TRUE; |
| 994 m_bDecodeInlineImage = FALSE; | 994 m_bDecodeInlineImage = FALSE; |
| 995 } | 995 } |
| OLD | NEW |