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

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

Issue 1172793002: Merge to XFA: Use stdint.h types throughout PDFium. (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/src/fpdfapi/fpdf_edit/editint.h ('k') | core/src/fpdfapi/fpdf_edit/fpdf_edit_create.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_page.h" 7 #include "../../../include/fpdfapi/fpdf_page.h"
8 #include "../../../include/fpdfapi/fpdf_serial.h" 8 #include "../../../include/fpdfapi/fpdf_serial.h"
9 #include "../../../include/fpdfapi/fpdf_module.h" 9 #include "../../../include/fpdfapi/fpdf_module.h"
10 #include "../../../include/fxcodec/fx_codec.h" 10 #include "../../../include/fxcodec/fx_codec.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 pContent = pArray->GetElement(i); 135 pContent = pArray->GetElement(i);
136 if (!pContent || pContent->GetType() != PDFOBJ_STREAM) { 136 if (!pContent || pContent->GetType() != PDFOBJ_STREAM) {
137 continue; 137 continue;
138 } 138 }
139 CPDF_StreamAcc* pStream = new CPDF_StreamAcc(); 139 CPDF_StreamAcc* pStream = new CPDF_StreamAcc();
140 pStream->LoadAllData((CPDF_Stream*)pContent); 140 pStream->LoadAllData((CPDF_Stream*)pContent);
141 pContentArray[i] = pStream; 141 pContentArray[i] = pStream;
142 size += pContentArray[i]->GetSize() + 1; 142 size += pContentArray[i]->GetSize() + 1;
143 } 143 }
144 int pos = 0; 144 int pos = 0;
145 FX_LPBYTE pBuf = FX_Alloc(FX_BYTE, size); 145 FX_LPBYTE pBuf = FX_Alloc(uint8_t, size);
146 for (i = 0; i < iCount; ++i) { 146 for (i = 0; i < iCount; ++i) {
147 FXSYS_memcpy32(pBuf + pos, pContentArray[i]->GetData(), pContentArra y[i]->GetSize()); 147 FXSYS_memcpy32(pBuf + pos, pContentArray[i]->GetData(), pContentArra y[i]->GetSize());
148 pos += pContentArray[i]->GetSize() + 1; 148 pos += pContentArray[i]->GetSize() + 1;
149 pBuf[pos - 1] = ' '; 149 pBuf[pos - 1] = ' ';
150 delete pContentArray[i]; 150 delete pContentArray[i];
151 } 151 }
152 ProcessForm(buf, pBuf, size, matrix); 152 ProcessForm(buf, pBuf, size, matrix);
153 FX_Free(pBuf); 153 FX_Free(pBuf);
154 FX_Free(pContentArray); 154 FX_Free(pContentArray);
155 } else if (type == PDFOBJ_STREAM) { 155 } else if (type == PDFOBJ_STREAM) {
156 CPDF_StreamAcc contentStream; 156 CPDF_StreamAcc contentStream;
157 contentStream.LoadAllData((CPDF_Stream*)pContent); 157 contentStream.LoadAllData((CPDF_Stream*)pContent);
158 ProcessForm(buf, contentStream.GetData(), contentStream.GetSize(), matri x); 158 ProcessForm(buf, contentStream.GetData(), contentStream.GetSize(), matri x);
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, pStream->GetOb jNum()); 163 m_pPage->m_pFormDict->SetAtReference("Contents", m_pDocument, pStream->GetOb jNum());
164 } 164 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_edit/editint.h ('k') | core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698