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 <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 if (m_pDocument->IsFormStream(pRes->GetRefObjNum(), bForm) && !bForm) | 729 if (m_pDocument->IsFormStream(pRes->GetRefObjNum(), bForm) && !bForm) |
730 return; | 730 return; |
731 } | 731 } |
732 | 732 |
733 CPDF_Stream* pXObject = ToStream(FindResourceObj("XObject", name)); | 733 CPDF_Stream* pXObject = ToStream(FindResourceObj("XObject", name)); |
734 if (!pXObject) { | 734 if (!pXObject) { |
735 m_bResourceMissing = TRUE; | 735 m_bResourceMissing = TRUE; |
736 return; | 736 return; |
737 } | 737 } |
738 | 738 |
739 CFX_ByteStringC type = pXObject->GetDict() | 739 CFX_ByteString type; |
740 ? pXObject->GetDict()->GetConstStringBy("Subtype") | 740 if (pXObject->GetDict()) |
741 : CFX_ByteStringC(); | 741 type = pXObject->GetDict()->GetStringBy("Subtype"); |
| 742 |
742 if (type == "Image") { | 743 if (type == "Image") { |
743 if (m_Options.m_bTextOnly) { | 744 if (m_Options.m_bTextOnly) { |
744 return; | 745 return; |
745 } | 746 } |
746 CPDF_ImageObject* pObj = AddImage(pXObject, NULL, FALSE); | 747 CPDF_ImageObject* pObj = AddImage(pXObject, NULL, FALSE); |
747 m_LastImageName = name; | 748 m_LastImageName = name; |
748 m_pLastImage = pObj->m_pImage; | 749 m_pLastImage = pObj->m_pImage; |
749 if (!m_pObjectHolder->HasImageMask()) | 750 if (!m_pObjectHolder->HasImageMask()) |
750 m_pObjectHolder->SetHasImageMask(m_pLastImage->IsMask()); | 751 m_pObjectHolder->SetHasImageMask(m_pLastImage->IsMask()); |
751 } else if (type == "Form") { | 752 } else if (type == "Form") { |
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1814 } else { | 1815 } else { |
1815 PDF_ReplaceAbbr(pElement); | 1816 PDF_ReplaceAbbr(pElement); |
1816 } | 1817 } |
1817 } | 1818 } |
1818 break; | 1819 break; |
1819 } | 1820 } |
1820 default: | 1821 default: |
1821 break; | 1822 break; |
1822 } | 1823 } |
1823 } | 1824 } |
OLD | NEW |