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

Side by Side Diff: core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp

Issue 1513103002: Merge to XFA: Get rid of most uses of CFX_PtrArray. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years 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/fpdfdoc/fpdf_tagged.h ('k') | core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.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 "core/include/fpdfapi/fpdf_module.h" 7 #include "core/include/fpdfapi/fpdf_module.h"
8 #include "core/include/fpdfapi/fpdf_page.h" 8 #include "core/include/fpdfapi/fpdf_page.h"
9 #include "core/include/fpdfapi/fpdf_serial.h" 9 #include "core/include/fpdfapi/fpdf_serial.h"
10 #include "core/src/fpdfapi/fpdf_page/pageint.h" 10 #include "core/src/fpdfapi/fpdf_page/pageint.h"
(...skipping 19 matching lines...) Expand all
30 CPDF_PageObject* pPageObject) { 30 CPDF_PageObject* pPageObject) {
31 if (!pPageObject) { 31 if (!pPageObject) {
32 return FALSE; 32 return FALSE;
33 } 33 }
34 return m_pageObjects.Add(pPageObject); 34 return m_pageObjects.Add(pPageObject);
35 } 35 }
36 void CPDF_PageContentGenerate::GenerateContent() { 36 void CPDF_PageContentGenerate::GenerateContent() {
37 CFX_ByteTextBuf buf; 37 CFX_ByteTextBuf buf;
38 CPDF_Dictionary* pPageDict = m_pPage->m_pFormDict; 38 CPDF_Dictionary* pPageDict = m_pPage->m_pFormDict;
39 for (int i = 0; i < m_pageObjects.GetSize(); ++i) { 39 for (int i = 0; i < m_pageObjects.GetSize(); ++i) {
40 CPDF_PageObject* pPageObj = (CPDF_PageObject*)m_pageObjects[i]; 40 CPDF_PageObject* pPageObj = m_pageObjects[i];
41 if (!pPageObj || pPageObj->m_Type != PDFPAGE_IMAGE) { 41 if (!pPageObj || pPageObj->m_Type != PDFPAGE_IMAGE) {
42 continue; 42 continue;
43 } 43 }
44 ProcessImage(buf, (CPDF_ImageObject*)pPageObj); 44 ProcessImage(buf, (CPDF_ImageObject*)pPageObj);
45 } 45 }
46 CPDF_Object* pContent = 46 CPDF_Object* pContent =
47 pPageDict ? pPageDict->GetElementValue("Contents") : NULL; 47 pPageDict ? pPageDict->GetElementValue("Contents") : NULL;
48 if (pContent != NULL) { 48 if (pContent != NULL) {
49 pPageDict->RemoveAt("Contents"); 49 pPageDict->RemoveAt("Contents");
50 } 50 }
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 CPDF_StreamAcc contentStream; 156 CPDF_StreamAcc contentStream;
157 contentStream.LoadAllData(pStream); 157 contentStream.LoadAllData(pStream);
158 ProcessForm(buf, contentStream.GetData(), contentStream.GetSize(), matrix); 158 ProcessForm(buf, contentStream.GetData(), contentStream.GetSize(), matrix);
159 } 159 }
160 CPDF_Stream* pStream = new CPDF_Stream(NULL, 0, NULL); 160 CPDF_Stream* pStream = new CPDF_Stream(NULL, 0, NULL);
161 pStream->SetData(buf.GetBuffer(), buf.GetLength(), FALSE, FALSE); 161 pStream->SetData(buf.GetBuffer(), buf.GetLength(), FALSE, FALSE);
162 m_pDocument->AddIndirectObject(pStream); 162 m_pDocument->AddIndirectObject(pStream);
163 m_pPage->m_pFormDict->SetAtReference("Contents", m_pDocument, 163 m_pPage->m_pFormDict->SetAtReference("Contents", m_pDocument,
164 pStream->GetObjNum()); 164 pStream->GetObjNum());
165 } 165 }
OLDNEW
« no previous file with comments | « core/include/fpdfdoc/fpdf_tagged.h ('k') | core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698