Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp

Issue 1153033009: Merge to XFA: Kill unused IPDF_ classes. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/include/fpdftext/fpdf_text.h ('k') | core/src/fpdfapi/fpdf_render/fpdf_render.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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) : CPDF_IndirectObjects(pParse r) 10 CPDF_Document::CPDF_Document(CPDF_Parser* pParser) : CPDF_IndirectObjects(pParse r)
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 } 290 }
291 CPDF_Dictionary* pPages = pRoot->GetDict(FX_BSTRC("Pages")); 291 CPDF_Dictionary* pPages = pRoot->GetDict(FX_BSTRC("Pages"));
292 if (pPages == NULL) { 292 if (pPages == NULL) {
293 return 0; 293 return 0;
294 } 294 }
295 if (!pPages->KeyExist(FX_BSTRC("Kids"))) { 295 if (!pPages->KeyExist(FX_BSTRC("Kids"))) {
296 return 1; 296 return 1;
297 } 297 }
298 return _CountPages(pPages, 0); 298 return _CountPages(pPages, 0);
299 } 299 }
300 static FX_BOOL _EnumPages(CPDF_Dictionary* pPages, IPDF_EnumPageHandler* pHandle r)
301 {
302 CPDF_Array* pKidList = pPages->GetArray(FX_BSTRC("Kids"));
303 if (pKidList == NULL) {
304 return pHandler->EnumPage(pPages);
305 }
306 for (FX_DWORD i = 0; i < pKidList->GetCount(); i ++) {
307 CPDF_Dictionary* pKid = pKidList->GetDict(i);
308 if (pKid == NULL) {
309 continue;
310 }
311 if (!pKid->KeyExist(FX_BSTRC("Kids"))) {
312 if (!pHandler->EnumPage(pKid)) {
313 return FALSE;
314 }
315 } else {
316 return _EnumPages(pKid, pHandler);
317 }
318 }
319 return TRUE;
320 }
321 void CPDF_Document::EnumPages(IPDF_EnumPageHandler* pHandler)
322 {
323 CPDF_Dictionary* pRoot = GetRoot();
324 if (pRoot == NULL) {
325 return;
326 }
327 CPDF_Dictionary* pPages = pRoot->GetDict(FX_BSTRC("Pages"));
328 if (pPages == NULL) {
329 return;
330 }
331 _EnumPages(pPages, pHandler);
332 }
333 FX_BOOL CPDF_Document::IsContentUsedElsewhere(FX_DWORD objnum, CPDF_Dictionary* pThisPageDict) 300 FX_BOOL CPDF_Document::IsContentUsedElsewhere(FX_DWORD objnum, CPDF_Dictionary* pThisPageDict)
334 { 301 {
335 for (int i = 0; i < m_PageList.GetSize(); i ++) { 302 for (int i = 0; i < m_PageList.GetSize(); i ++) {
336 CPDF_Dictionary* pPageDict = GetPage(i); 303 CPDF_Dictionary* pPageDict = GetPage(i);
337 if (pPageDict == pThisPageDict) { 304 if (pPageDict == pThisPageDict) {
338 continue; 305 continue;
339 } 306 }
340 CPDF_Object* pContents = pPageDict ? pPageDict->GetElement(FX_BSTRC("Con tents")) : NULL; 307 CPDF_Object* pContents = pPageDict ? pPageDict->GetElement(FX_BSTRC("Con tents")) : NULL;
341 if (pContents == NULL) { 308 if (pContents == NULL) {
342 continue; 309 continue;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 if (m_pDocPage) { 360 if (m_pDocPage) {
394 CPDF_ModuleMgr::Get()->GetPageModule()->ClearDoc(this); 361 CPDF_ModuleMgr::Get()->GetPageModule()->ClearDoc(this);
395 } 362 }
396 } 363 }
397 void CPDF_Document::ClearRenderData() 364 void CPDF_Document::ClearRenderData()
398 { 365 {
399 if (m_pDocRender) { 366 if (m_pDocRender) {
400 CPDF_ModuleMgr::Get()->GetRenderModule()->ClearDocData(m_pDocRender); 367 CPDF_ModuleMgr::Get()->GetRenderModule()->ClearDocData(m_pDocRender);
401 } 368 }
402 } 369 }
OLDNEW
« no previous file with comments | « core/include/fpdftext/fpdf_text.h ('k') | core/src/fpdfapi/fpdf_render/fpdf_render.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698