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

Side by Side Diff: fpdfsdk/fpdf_flatten.cpp

Issue 1918113002: Clean up CPDF_Page. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: delete more dead code Created 4 years, 7 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
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 "public/fpdf_flatten.h" 7 #include "public/fpdf_flatten.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 27 matching lines...) Expand all
38 rect.bottom - rcPage.bottom < -10.000001f) 38 rect.bottom - rcPage.bottom < -10.000001f)
39 return FALSE; 39 return FALSE;
40 } 40 }
41 41
42 return TRUE; 42 return TRUE;
43 } 43 }
44 44
45 void GetContentsRect(CPDF_Document* pDoc, 45 void GetContentsRect(CPDF_Document* pDoc,
46 CPDF_Dictionary* pDict, 46 CPDF_Dictionary* pDict,
47 CPDF_RectArray* pRectArray) { 47 CPDF_RectArray* pRectArray) {
48 std::unique_ptr<CPDF_Page> pPDFPage(new CPDF_Page); 48 std::unique_ptr<CPDF_Page> pPDFPage(new CPDF_Page(pDoc, pDict, false));
49 pPDFPage->Load(pDoc, pDict, FALSE); 49 pPDFPage->ParseContent();
50 pPDFPage->ParseContent(nullptr);
51 50
52 for (auto& pPageObject : *pPDFPage->GetPageObjectList()) { 51 for (auto& pPageObject : *pPDFPage->GetPageObjectList()) {
53 if (!pPageObject) 52 if (!pPageObject)
54 continue; 53 continue;
55 54
56 CFX_FloatRect rc; 55 CFX_FloatRect rc;
57 rc.left = pPageObject->m_Left; 56 rc.left = pPageObject->m_Left;
58 rc.right = pPageObject->m_Right; 57 rc.right = pPageObject->m_Right;
59 rc.bottom = pPageObject->m_Bottom; 58 rc.bottom = pPageObject->m_Bottom;
60 rc.top = pPageObject->m_Top; 59 rc.top = pPageObject->m_Top;
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 sStream += sTemp; 507 sStream += sTemp;
509 pNewXObject->SetData(sStream.raw_str(), sStream.GetLength(), FALSE, FALSE); 508 pNewXObject->SetData(sStream.raw_str(), sStream.GetLength(), FALSE, FALSE);
510 } 509 }
511 pPageDict->RemoveAt("Annots"); 510 pPageDict->RemoveAt("Annots");
512 511
513 ObjectArray.RemoveAll(); 512 ObjectArray.RemoveAll();
514 RectArray.RemoveAll(); 513 RectArray.RemoveAll();
515 514
516 return FLATTEN_SUCCESS; 515 return FLATTEN_SUCCESS;
517 } 516 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698