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/fpdfapi/fpdf_page/pageint.h" | 7 #include "core/fpdfapi/fpdf_page/pageint.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 return; | 736 return; |
737 } | 737 } |
738 | 738 |
739 CFX_ByteString type; | 739 CFX_ByteString type; |
740 if (pXObject->GetDict()) | 740 if (pXObject->GetDict()) |
741 type = pXObject->GetDict()->GetStringBy("Subtype"); | 741 type = pXObject->GetDict()->GetStringBy("Subtype"); |
742 | 742 |
743 if (type == "Image") { | 743 if (type == "Image") { |
744 CPDF_ImageObject* pObj = AddImage(pXObject, nullptr, false); | 744 CPDF_ImageObject* pObj = AddImage(pXObject, nullptr, false); |
745 m_LastImageName = name; | 745 m_LastImageName = name; |
746 m_pLastImage = pObj->m_pImage; | 746 m_pLastImage = pObj->GetImage(); |
747 if (!m_pObjectHolder->HasImageMask()) | 747 if (!m_pObjectHolder->HasImageMask()) |
748 m_pObjectHolder->SetHasImageMask(m_pLastImage->IsMask()); | 748 m_pObjectHolder->SetHasImageMask(m_pLastImage->IsMask()); |
749 } else if (type == "Form") { | 749 } else if (type == "Form") { |
750 AddForm(pXObject); | 750 AddForm(pXObject); |
751 } | 751 } |
752 } | 752 } |
753 | 753 |
754 void CPDF_StreamContentParser::AddForm(CPDF_Stream* pStream) { | 754 void CPDF_StreamContentParser::AddForm(CPDF_Stream* pStream) { |
755 std::unique_ptr<CPDF_FormObject> pFormObj(new CPDF_FormObject); | 755 std::unique_ptr<CPDF_FormObject> pFormObj(new CPDF_FormObject); |
756 pFormObj->m_pForm.reset( | 756 pFormObj->m_pForm.reset( |
(...skipping 28 matching lines...) Expand all Loading... |
785 std::unique_ptr<CPDF_ImageObject> pImageObj(new CPDF_ImageObject); | 785 std::unique_ptr<CPDF_ImageObject> pImageObj(new CPDF_ImageObject); |
786 if (pImage) { | 786 if (pImage) { |
787 pImageObj->m_pImage = | 787 pImageObj->m_pImage = |
788 m_pDocument->GetPageData()->GetImage(pImage->GetStream()); | 788 m_pDocument->GetPageData()->GetImage(pImage->GetStream()); |
789 } else if (pStream->GetObjNum()) { | 789 } else if (pStream->GetObjNum()) { |
790 pImageObj->m_pImage = m_pDocument->LoadImageF(pStream); | 790 pImageObj->m_pImage = m_pDocument->LoadImageF(pStream); |
791 } else { | 791 } else { |
792 pImageObj->m_pImage = new CPDF_Image(m_pDocument); | 792 pImageObj->m_pImage = new CPDF_Image(m_pDocument); |
793 pImageObj->m_pImage->LoadImageF(pStream, bInline); | 793 pImageObj->m_pImage->LoadImageF(pStream, bInline); |
794 } | 794 } |
795 SetGraphicStates(pImageObj.get(), pImageObj->m_pImage->IsMask(), FALSE, | 795 SetGraphicStates(pImageObj.get(), pImageObj->GetImage()->IsMask(), FALSE, |
796 FALSE); | 796 FALSE); |
797 pImageObj->m_Matrix = ImageMatrix; | 797 pImageObj->m_Matrix = ImageMatrix; |
798 pImageObj->CalcBoundingBox(); | 798 pImageObj->CalcBoundingBox(); |
799 CPDF_ImageObject* pRet = pImageObj.get(); | 799 CPDF_ImageObject* pRet = pImageObj.get(); |
800 m_pObjectHolder->GetPageObjectList()->push_back(std::move(pImageObj)); | 800 m_pObjectHolder->GetPageObjectList()->push_back(std::move(pImageObj)); |
801 return pRet; | 801 return pRet; |
802 } | 802 } |
803 | 803 |
804 void CPDF_StreamContentParser::Handle_MarkPlace_Dictionary() {} | 804 void CPDF_StreamContentParser::Handle_MarkPlace_Dictionary() {} |
805 | 805 |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1683 } else { | 1683 } else { |
1684 PDF_ReplaceAbbr(pElement); | 1684 PDF_ReplaceAbbr(pElement); |
1685 } | 1685 } |
1686 } | 1686 } |
1687 break; | 1687 break; |
1688 } | 1688 } |
1689 default: | 1689 default: |
1690 break; | 1690 break; |
1691 } | 1691 } |
1692 } | 1692 } |
OLD | NEW |