Chromium Code Reviews| 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 "../include/fpdfppo.h" | 7 #include "../include/fpdfppo.h" |
| 8 #include "../include/fsdk_define.h" | 8 #include "../include/fsdk_define.h" |
| 9 | 9 |
| 10 class CPDF_PageOrganizer | 10 class CPDF_PageOrganizer |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 306 | 306 |
| 307 size_t dwNewObjNum = 0; | 307 size_t dwNewObjNum = 0; |
| 308 | 308 |
| 309 pMapPtrToPtr->Lookup((FX_LPVOID)dwObjnum, (FX_LPVOID&)dwNewObjNum); | 309 pMapPtrToPtr->Lookup((FX_LPVOID)dwObjnum, (FX_LPVOID&)dwNewObjNum); |
| 310 if(dwNewObjNum) | 310 if(dwNewObjNum) |
| 311 { | 311 { |
| 312 return (int)dwNewObjNum; | 312 return (int)dwNewObjNum; |
| 313 } | 313 } |
| 314 else | 314 else |
| 315 { | 315 { |
| 316 » » CPDF_Object* pClone = pRef->GetDirect()->Clone(); | 316 » » CPDF_Object* pClone = NULL; |
| 317 if (pRef) { | |
|
Bo Xu
2014/09/08 00:54:24
No need to check pRef since line 303 already check
| |
| 318 CPDF_Object* pDirect = pRef->GetDirect(); | |
| 319 if (pDirect) { | |
| 320 pClone = pDirect->Clone(); | |
| 321 } | |
| 322 } | |
| 317 if(!pClone) | 323 if(!pClone) |
| 318 return 0; | 324 return 0; |
| 319 | 325 |
| 320 if(pClone->GetType() == PDFOBJ_DICTIONARY) | 326 if(pClone->GetType() == PDFOBJ_DICTIONARY) |
| 321 { | 327 { |
| 322 CPDF_Dictionary* pDictClone = (CPDF_Dictionary*)pClone; | 328 CPDF_Dictionary* pDictClone = (CPDF_Dictionary*)pClone; |
| 323 if(pDictClone->KeyExist("Type")) | 329 if(pDictClone->KeyExist("Type")) |
| 324 { | 330 { |
| 325 CFX_ByteString strType = pDictClone->GetString(" Type"); | 331 CFX_ByteString strType = pDictClone->GetString(" Type"); |
| 326 if(!FXSYS_stricmp(strType, "Pages")) | 332 if(!FXSYS_stricmp(strType, "Pages")) |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 455 if(!pSrcDict) | 461 if(!pSrcDict) |
| 456 return FALSE; | 462 return FALSE; |
| 457 CPDF_Document* pDstDoc = (CPDF_Document*)dest_doc; | 463 CPDF_Document* pDstDoc = (CPDF_Document*)dest_doc; |
| 458 CPDF_Dictionary* pDstDict = pDstDoc->GetRoot(); | 464 CPDF_Dictionary* pDstDict = pDstDoc->GetRoot(); |
| 459 if(!pDstDict) | 465 if(!pDstDict) |
| 460 return FALSE; | 466 return FALSE; |
| 461 pDstDict->SetAt(FX_BSTRC("ViewerPreferences"), pSrcDict->Clone(TRUE)); | 467 pDstDict->SetAt(FX_BSTRC("ViewerPreferences"), pSrcDict->Clone(TRUE)); |
| 462 return TRUE; | 468 return TRUE; |
| 463 } | 469 } |
| 464 | 470 |
| OLD | NEW |