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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 CPDF_Dictionary* pPageDict = GetPage(i); | 298 CPDF_Dictionary* pPageDict = GetPage(i); |
299 if (pPageDict == pThisPageDict) { | 299 if (pPageDict == pThisPageDict) { |
300 continue; | 300 continue; |
301 } | 301 } |
302 CPDF_Object* pContents = | 302 CPDF_Object* pContents = |
303 pPageDict ? pPageDict->GetElement(FX_BSTRC("Contents")) : NULL; | 303 pPageDict ? pPageDict->GetElement(FX_BSTRC("Contents")) : NULL; |
304 if (pContents == NULL) { | 304 if (pContents == NULL) { |
305 continue; | 305 continue; |
306 } | 306 } |
307 if (pContents->GetDirectType() == PDFOBJ_ARRAY) { | 307 if (pContents->GetDirectType() == PDFOBJ_ARRAY) { |
308 CPDF_Array* pArray = (CPDF_Array*)pContents->GetDirect(); | 308 CPDF_Array* pArray = pContents->GetDirect()->AsArray(); |
309 for (FX_DWORD j = 0; j < pArray->GetCount(); j++) { | 309 for (FX_DWORD j = 0; j < pArray->GetCount(); j++) { |
310 CPDF_Object* pRef = pArray->GetElement(j); | 310 CPDF_Object* pRef = pArray->GetElement(j); |
311 if (pRef == NULL || pRef->GetType() != PDFOBJ_REFERENCE) { | 311 if (pRef == NULL || pRef->GetType() != PDFOBJ_REFERENCE) { |
312 continue; | 312 continue; |
313 } | 313 } |
314 if (((CPDF_Reference*)pRef)->GetRefObjNum() == objnum) { | 314 if (((CPDF_Reference*)pRef)->GetRefObjNum() == objnum) { |
315 return TRUE; | 315 return TRUE; |
316 } | 316 } |
317 } | 317 } |
318 } else if (pContents->GetObjNum() == objnum) { | 318 } else if (pContents->GetObjNum() == objnum) { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 void CPDF_Document::ClearPageData() { | 352 void CPDF_Document::ClearPageData() { |
353 if (m_pDocPage) { | 353 if (m_pDocPage) { |
354 CPDF_ModuleMgr::Get()->GetPageModule()->ClearDoc(this); | 354 CPDF_ModuleMgr::Get()->GetPageModule()->ClearDoc(this); |
355 } | 355 } |
356 } | 356 } |
357 void CPDF_Document::ClearRenderData() { | 357 void CPDF_Document::ClearRenderData() { |
358 if (m_pDocRender) { | 358 if (m_pDocRender) { |
359 CPDF_ModuleMgr::Get()->GetRenderModule()->ClearDocData(m_pDocRender); | 359 CPDF_ModuleMgr::Get()->GetRenderModule()->ClearDocData(m_pDocRender); |
360 } | 360 } |
361 } | 361 } |
OLD | NEW |