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