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

Side by Side Diff: fpdfsdk/fpdfppo.cpp

Issue 1867183002: Use std::vector as internal storage for CPDF_Array (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 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_ppo.h" 7 #include "public/fpdf_ppo.h"
8 8
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 if (!UpdateReference(pNextObj, pDoc, pObjNumberMap)) 231 if (!UpdateReference(pNextObj, pDoc, pObjNumberMap))
232 pDict->RemoveAt(key.AsByteStringC()); 232 pDict->RemoveAt(key.AsByteStringC());
233 } else { 233 } else {
234 return FALSE; 234 return FALSE;
235 } 235 }
236 } 236 }
237 break; 237 break;
238 } 238 }
239 case CPDF_Object::ARRAY: { 239 case CPDF_Object::ARRAY: {
240 CPDF_Array* pArray = pObj->AsArray(); 240 CPDF_Array* pArray = pObj->AsArray();
241 uint32_t count = pArray->GetCount(); 241 for (size_t i = 0; i < pArray->GetCount(); ++i) {
242 for (uint32_t i = 0; i < count; ++i) {
243 CPDF_Object* pNextObj = pArray->GetObjectAt(i); 242 CPDF_Object* pNextObj = pArray->GetObjectAt(i);
244 if (!pNextObj) 243 if (!pNextObj)
245 return FALSE; 244 return FALSE;
246 if (!UpdateReference(pNextObj, pDoc, pObjNumberMap)) 245 if (!UpdateReference(pNextObj, pDoc, pObjNumberMap))
247 return FALSE; 246 return FALSE;
248 } 247 }
249 break; 248 break;
250 } 249 }
251 case CPDF_Object::STREAM: { 250 case CPDF_Object::STREAM: {
252 CPDF_Stream* pStream = pObj->AsStream(); 251 CPDF_Stream* pStream = pObj->AsStream();
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 if (!pSrcDict) 402 if (!pSrcDict)
404 return FALSE; 403 return FALSE;
405 404
406 CPDF_Dictionary* pDstDict = pDstDoc->GetRoot(); 405 CPDF_Dictionary* pDstDict = pDstDoc->GetRoot();
407 if (!pDstDict) 406 if (!pDstDict)
408 return FALSE; 407 return FALSE;
409 408
410 pDstDict->SetAt("ViewerPreferences", pSrcDict->Clone(TRUE)); 409 pDstDict->SetAt("ViewerPreferences", pSrcDict->Clone(TRUE));
411 return TRUE; 410 return TRUE;
412 } 411 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698