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

Side by Side Diff: fpdfsdk/src/fpdf_flatten.cpp

Issue 1613823003: Mege to XFA: Redo CPDF_PageObjects - part 1 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 4 years, 11 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/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp ('k') | fpdfsdk/src/fpdfeditpage.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 "public/fpdf_flatten.h" 7 #include "public/fpdf_flatten.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 22 matching lines...) Expand all
33 } 33 }
34 34
35 return TRUE; 35 return TRUE;
36 } 36 }
37 37
38 FX_BOOL GetContentsRect(CPDF_Document* pDoc, 38 FX_BOOL GetContentsRect(CPDF_Document* pDoc,
39 CPDF_Dictionary* pDict, 39 CPDF_Dictionary* pDict,
40 CPDF_RectArray* pRectArray) { 40 CPDF_RectArray* pRectArray) {
41 CPDF_Page* pPDFPage = new CPDF_Page; 41 CPDF_Page* pPDFPage = new CPDF_Page;
42 pPDFPage->Load(pDoc, pDict, FALSE); 42 pPDFPage->Load(pDoc, pDict, FALSE);
43 pPDFPage->ParseContent(); 43 pPDFPage->ParseContent(nullptr);
44 44
45 FX_POSITION pos = pPDFPage->GetFirstObjectPosition(); 45 FX_POSITION pos = pPDFPage->GetFirstObjectPosition();
46
47 while (pos) { 46 while (pos) {
48 CPDF_PageObject* pPageObject = pPDFPage->GetNextObject(pos); 47 CPDF_PageObject* pPageObject = pPDFPage->GetNextObject(pos);
49 if (!pPageObject) 48 if (!pPageObject)
50 continue; 49 continue;
51 50
52 CPDF_Rect rc; 51 CPDF_Rect rc;
53 rc.left = pPageObject->m_Left; 52 rc.left = pPageObject->m_Left;
54 rc.right = pPageObject->m_Right; 53 rc.right = pPageObject->m_Right;
55 rc.bottom = pPageObject->m_Bottom; 54 rc.bottom = pPageObject->m_Bottom;
56 rc.top = pPageObject->m_Top; 55 rc.top = pPageObject->m_Top;
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 pNewXObject->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE, 514 pNewXObject->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE,
516 FALSE); 515 FALSE);
517 } 516 }
518 pPageDict->RemoveAt("Annots"); 517 pPageDict->RemoveAt("Annots");
519 518
520 ObjectArray.RemoveAll(); 519 ObjectArray.RemoveAll();
521 RectArray.RemoveAll(); 520 RectArray.RemoveAll();
522 521
523 return FLATTEN_SUCCESS; 522 return FLATTEN_SUCCESS;
524 } 523 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp ('k') | fpdfsdk/src/fpdfeditpage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698