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 "../../../include/fpdfapi/fpdf_parser.h" | 7 #include "../../../include/fpdfapi/fpdf_parser.h" |
8 #include "../../../include/fpdfapi/fpdf_module.h" | 8 #include "../../../include/fpdfapi/fpdf_module.h" |
9 | 9 |
10 | 10 |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 FX_BOOL CPDF_Document::IsOwner() const { | 331 FX_BOOL CPDF_Document::IsOwner() const { |
332 if (m_pParser == NULL) { | 332 if (m_pParser == NULL) { |
333 return TRUE; | 333 return TRUE; |
334 } | 334 } |
335 return m_pParser->IsOwner(); | 335 return m_pParser->IsOwner(); |
336 } | 336 } |
337 FX_BOOL CPDF_Document::IsFormStream(FX_DWORD objnum, FX_BOOL& bForm) const { | 337 FX_BOOL CPDF_Document::IsFormStream(FX_DWORD objnum, FX_BOOL& bForm) const { |
338 { | 338 { |
339 CPDF_Object* pObj; | 339 CPDF_Object* pObj; |
340 if (m_IndirectObjs.Lookup((void*)(uintptr_t)objnum, (void*&)pObj)) { | 340 if (m_IndirectObjs.Lookup((void*)(uintptr_t)objnum, (void*&)pObj)) { |
341 bForm = pObj->GetType() == PDFOBJ_STREAM && | 341 CPDF_Stream* pStream = pObj->AsStream(); |
342 ((CPDF_Stream*)pObj)->GetDict()->GetString(FX_BSTRC("Subtype")) == | 342 bForm = pStream && |
| 343 pStream->GetDict()->GetString(FX_BSTRC("Subtype")) == |
343 FX_BSTRC("Form"); | 344 FX_BSTRC("Form"); |
344 return TRUE; | 345 return TRUE; |
345 } | 346 } |
346 } | 347 } |
347 if (m_pParser == NULL) { | 348 if (m_pParser == NULL) { |
348 bForm = FALSE; | 349 bForm = FALSE; |
349 return TRUE; | 350 return TRUE; |
350 } | 351 } |
351 return m_pParser->IsFormStream(objnum, bForm); | 352 return m_pParser->IsFormStream(objnum, bForm); |
352 } | 353 } |
353 void CPDF_Document::ClearPageData() { | 354 void CPDF_Document::ClearPageData() { |
354 if (m_pDocPage) { | 355 if (m_pDocPage) { |
355 CPDF_ModuleMgr::Get()->GetPageModule()->ClearDoc(this); | 356 CPDF_ModuleMgr::Get()->GetPageModule()->ClearDoc(this); |
356 } | 357 } |
357 } | 358 } |
358 void CPDF_Document::ClearRenderData() { | 359 void CPDF_Document::ClearRenderData() { |
359 if (m_pDocRender) { | 360 if (m_pDocRender) { |
360 CPDF_ModuleMgr::Get()->GetRenderModule()->ClearDocData(m_pDocRender); | 361 CPDF_ModuleMgr::Get()->GetRenderModule()->ClearDocData(m_pDocRender); |
361 } | 362 } |
362 } | 363 } |
OLD | NEW |