| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |