OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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/edit/cpdf_pagecontentgenerator.h" | 7 #include "core/fpdfapi/edit/cpdf_pagecontentgenerator.h" |
8 | 8 |
9 #include "core/fpdfapi/edit/cpdf_creator.h" | 9 #include "core/fpdfapi/edit/cpdf_creator.h" |
10 #include "core/fpdfapi/page/cpdf_docpagedata.h" | 10 #include "core/fpdfapi/page/cpdf_docpagedata.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 CPDF_Stream* pStream = m_pDocument->NewIndirect<CPDF_Stream>(); | 55 CPDF_Stream* pStream = m_pDocument->NewIndirect<CPDF_Stream>(); |
56 pStream->SetData(buf.GetBuffer(), buf.GetLength()); | 56 pStream->SetData(buf.GetBuffer(), buf.GetLength()); |
57 pPageDict->SetReferenceFor("Contents", m_pDocument, pStream); | 57 pPageDict->SetReferenceFor("Contents", m_pDocument, pStream); |
58 } | 58 } |
59 | 59 |
60 CFX_ByteString CPDF_PageContentGenerator::RealizeResource( | 60 CFX_ByteString CPDF_PageContentGenerator::RealizeResource( |
61 uint32_t dwResourceObjNum, | 61 uint32_t dwResourceObjNum, |
62 const CFX_ByteString& bsType) { | 62 const CFX_ByteString& bsType) { |
63 ASSERT(dwResourceObjNum); | 63 ASSERT(dwResourceObjNum); |
64 if (!m_pPage->m_pResources) { | 64 if (!m_pPage->m_pResources) { |
65 m_pPage->m_pResources = m_pDocument->NewIndirect<CPDF_Dictionary>( | 65 m_pPage->m_pResources = m_pDocument->NewIndirect<CPDF_Dictionary>(); |
66 m_pDocument->GetByteStringPool()); | |
67 m_pPage->m_pFormDict->SetReferenceFor("Resources", m_pDocument, | 66 m_pPage->m_pFormDict->SetReferenceFor("Resources", m_pDocument, |
68 m_pPage->m_pResources); | 67 m_pPage->m_pResources); |
69 } | 68 } |
70 CPDF_Dictionary* pResList = m_pPage->m_pResources->GetDictFor(bsType); | 69 CPDF_Dictionary* pResList = m_pPage->m_pResources->GetDictFor(bsType); |
71 if (!pResList) { | 70 if (!pResList) { |
72 pResList = new CPDF_Dictionary(m_pDocument->GetByteStringPool()); | 71 pResList = new CPDF_Dictionary(m_pDocument->GetByteStringPool()); |
73 m_pPage->m_pResources->SetFor(bsType, pResList); | 72 m_pPage->m_pResources->SetFor(bsType, pResList); |
74 } | 73 } |
75 CFX_ByteString name; | 74 CFX_ByteString name; |
76 int idnum = 1; | 75 int idnum = 1; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 FX_Free(pContentArray); | 174 FX_Free(pContentArray); |
176 } else if (CPDF_Stream* pStream = pContent->AsStream()) { | 175 } else if (CPDF_Stream* pStream = pContent->AsStream()) { |
177 CPDF_StreamAcc contentStream; | 176 CPDF_StreamAcc contentStream; |
178 contentStream.LoadAllData(pStream); | 177 contentStream.LoadAllData(pStream); |
179 ProcessForm(buf, contentStream.GetData(), contentStream.GetSize(), matrix); | 178 ProcessForm(buf, contentStream.GetData(), contentStream.GetSize(), matrix); |
180 } | 179 } |
181 CPDF_Stream* pStream = m_pDocument->NewIndirect<CPDF_Stream>(); | 180 CPDF_Stream* pStream = m_pDocument->NewIndirect<CPDF_Stream>(); |
182 pStream->SetData(buf.GetBuffer(), buf.GetLength()); | 181 pStream->SetData(buf.GetBuffer(), buf.GetLength()); |
183 m_pPage->m_pFormDict->SetReferenceFor("Contents", m_pDocument, pStream); | 182 m_pPage->m_pFormDict->SetReferenceFor("Contents", m_pDocument, pStream); |
184 } | 183 } |
OLD | NEW |