| 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/parser/cpdf_document.h" | 7 #include "core/fpdfapi/parser/cpdf_document.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 CPDF_Pattern* CPDF_Document::LoadPattern(CPDF_Object* pPatternObj, | 634 CPDF_Pattern* CPDF_Document::LoadPattern(CPDF_Object* pPatternObj, |
| 635 bool bShading, | 635 bool bShading, |
| 636 const CFX_Matrix& matrix) { | 636 const CFX_Matrix& matrix) { |
| 637 return m_pDocPage->GetPattern(pPatternObj, bShading, matrix); | 637 return m_pDocPage->GetPattern(pPatternObj, bShading, matrix); |
| 638 } | 638 } |
| 639 | 639 |
| 640 CPDF_IccProfile* CPDF_Document::LoadIccProfile(CPDF_Stream* pStream) { | 640 CPDF_IccProfile* CPDF_Document::LoadIccProfile(CPDF_Stream* pStream) { |
| 641 return m_pDocPage->GetIccProfile(pStream); | 641 return m_pDocPage->GetIccProfile(pStream); |
| 642 } | 642 } |
| 643 | 643 |
| 644 CPDF_Image* CPDF_Document::LoadImageF(CPDF_Object* pObj) { | 644 CPDF_Image* CPDF_Document::LoadImageFromPageData(uint32_t dwStreamObjNum) { |
| 645 if (!pObj) | 645 ASSERT(dwStreamObjNum); |
| 646 return nullptr; | 646 return m_pDocPage->GetImage(dwStreamObjNum); |
| 647 | |
| 648 ASSERT(pObj->GetObjNum()); | |
| 649 return m_pDocPage->GetImage(pObj); | |
| 650 } | 647 } |
| 651 | 648 |
| 652 void CPDF_Document::CreateNewDoc() { | 649 void CPDF_Document::CreateNewDoc() { |
| 653 ASSERT(!m_pRootDict && !m_pInfoDict); | 650 ASSERT(!m_pRootDict && !m_pInfoDict); |
| 654 m_pRootDict = new CPDF_Dictionary(m_pByteStringPool); | 651 m_pRootDict = new CPDF_Dictionary(m_pByteStringPool); |
| 655 m_pRootDict->SetNameFor("Type", "Catalog"); | 652 m_pRootDict->SetNameFor("Type", "Catalog"); |
| 656 AddIndirectObject(m_pRootDict); | 653 AddIndirectObject(m_pRootDict); |
| 657 | 654 |
| 658 CPDF_Dictionary* pPages = new CPDF_Dictionary(m_pByteStringPool); | 655 CPDF_Dictionary* pPages = new CPDF_Dictionary(m_pByteStringPool); |
| 659 pPages->SetNameFor("Type", "Pages"); | 656 pPages->SetNameFor("Type", "Pages"); |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1046 pBBox, pLogFont->lfWeight / 5); | 1043 pBBox, pLogFont->lfWeight / 5); |
| 1047 pFontDesc->SetIntegerFor("CapHeight", capheight); | 1044 pFontDesc->SetIntegerFor("CapHeight", capheight); |
| 1048 pFontDict->SetReferenceFor("FontDescriptor", this, | 1045 pFontDict->SetReferenceFor("FontDescriptor", this, |
| 1049 AddIndirectObject(pFontDesc)); | 1046 AddIndirectObject(pFontDesc)); |
| 1050 hFont = SelectObject(hDC, hFont); | 1047 hFont = SelectObject(hDC, hFont); |
| 1051 DeleteObject(hFont); | 1048 DeleteObject(hFont); |
| 1052 DeleteDC(hDC); | 1049 DeleteDC(hDC); |
| 1053 return LoadFont(pBaseDict); | 1050 return LoadFont(pBaseDict); |
| 1054 } | 1051 } |
| 1055 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ | 1052 #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ |
| OLD | NEW |