| 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 <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 case PDFOBJ_REFERENCE: { | 206 case PDFOBJ_REFERENCE: { |
| 207 CPDF_Reference* pReference = pObj->AsReference(); | 207 CPDF_Reference* pReference = pObj->AsReference(); |
| 208 FX_DWORD newobjnum = GetNewObjId(pDoc, pObjNumberMap, pReference); | 208 FX_DWORD newobjnum = GetNewObjId(pDoc, pObjNumberMap, pReference); |
| 209 if (newobjnum == 0) | 209 if (newobjnum == 0) |
| 210 return FALSE; | 210 return FALSE; |
| 211 pReference->SetRef(pDoc, newobjnum); | 211 pReference->SetRef(pDoc, newobjnum); |
| 212 break; | 212 break; |
| 213 } | 213 } |
| 214 case PDFOBJ_DICTIONARY: { | 214 case PDFOBJ_DICTIONARY: { |
| 215 CPDF_Dictionary* pDict = pObj->AsDictionary(); | 215 CPDF_Dictionary* pDict = pObj->AsDictionary(); |
| 216 for (const auto& it : *pDict) { | 216 auto it = pDict->begin(); |
| 217 const CFX_ByteString& key = it.first; | 217 while (it != pDict->end()) { |
| 218 CPDF_Object* pNextObj = it.second; | 218 const CFX_ByteString& key = it->first; |
| 219 CPDF_Object* pNextObj = it->second; |
| 220 ++it; |
| 219 if (!FXSYS_strcmp(key, "Parent") || !FXSYS_strcmp(key, "Prev") || | 221 if (!FXSYS_strcmp(key, "Parent") || !FXSYS_strcmp(key, "Prev") || |
| 220 !FXSYS_strcmp(key, "First")) { | 222 !FXSYS_strcmp(key, "First")) { |
| 221 continue; | 223 continue; |
| 222 } | 224 } |
| 223 if (pNextObj) { | 225 if (pNextObj) { |
| 224 if (!UpdateReference(pNextObj, pDoc, pObjNumberMap)) | 226 if (!UpdateReference(pNextObj, pDoc, pObjNumberMap)) |
| 225 pDict->RemoveAt(key); | 227 pDict->RemoveAt(key); |
| 226 } else { | 228 } else { |
| 227 return FALSE; | 229 return FALSE; |
| 228 } | 230 } |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 if (!pSrcDict) | 398 if (!pSrcDict) |
| 397 return FALSE; | 399 return FALSE; |
| 398 | 400 |
| 399 CPDF_Dictionary* pDstDict = pDstDoc->GetRoot(); | 401 CPDF_Dictionary* pDstDict = pDstDoc->GetRoot(); |
| 400 if (!pDstDict) | 402 if (!pDstDict) |
| 401 return FALSE; | 403 return FALSE; |
| 402 | 404 |
| 403 pDstDict->SetAt("ViewerPreferences", pSrcDict->Clone(TRUE)); | 405 pDstDict->SetAt("ViewerPreferences", pSrcDict->Clone(TRUE)); |
| 404 return TRUE; | 406 return TRUE; |
| 405 } | 407 } |
| OLD | NEW |