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

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

Issue 1419643005: Merge to XFA: Add type cast definitions for CPDF_Array. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 2 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 #include "../include/fsdk_define.h" 8 #include "../include/fsdk_define.h"
9 9
10 typedef CFX_ArrayTemplate<CPDF_Dictionary*> CPDF_ObjectArray; 10 typedef CFX_ArrayTemplate<CPDF_Dictionary*> CPDF_ObjectArray;
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 CFX_ByteString sBody = 219 CFX_ByteString sBody =
220 CFX_ByteString((const FX_CHAR*)acc.GetData(), acc.GetSize()); 220 CFX_ByteString((const FX_CHAR*)acc.GetData(), acc.GetSize());
221 sStream = sStream + sBody + "\nQ"; 221 sStream = sStream + sBody + "\nQ";
222 pContents->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE, 222 pContents->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE,
223 FALSE); 223 FALSE);
224 pContentsArray->AddReference(pDocument, dwObjNum); 224 pContentsArray->AddReference(pDocument, dwObjNum);
225 break; 225 break;
226 } 226 }
227 227
228 case PDFOBJ_ARRAY: { 228 case PDFOBJ_ARRAY: {
229 pContentsArray = (CPDF_Array*)pContentsObj; 229 pContentsArray = pContentsObj->AsArray();
230 break; 230 break;
231 } 231 }
232 default: 232 default:
233 break; 233 break;
234 } 234 }
235 235
236 if (!pContentsArray) 236 if (!pContentsArray)
237 return; 237 return;
238 238
239 FX_DWORD dwObjNum = pDocument->AddIndirectObject(pContentsArray); 239 FX_DWORD dwObjNum = pDocument->AddIndirectObject(pContentsArray);
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 pNewXObject->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE, 516 pNewXObject->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE,
517 FALSE); 517 FALSE);
518 } 518 }
519 pPageDict->RemoveAt("Annots"); 519 pPageDict->RemoveAt("Annots");
520 520
521 ObjectArray.RemoveAll(); 521 ObjectArray.RemoveAll();
522 RectArray.RemoveAll(); 522 RectArray.RemoveAll();
523 523
524 return FLATTEN_SUCCESS; 524 return FLATTEN_SUCCESS;
525 } 525 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698