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