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 "../../public/fpdf_ppo.h" | 7 #include "../../public/fpdf_ppo.h" |
| 8 #include "../include/fsdk_define.h" | 8 #include "../include/fsdk_define.h" |
| 9 #include "../include/fpdfxfa/fpdfxfa_doc.h" | 9 #include "../include/fpdfxfa/fpdfxfa_doc.h" |
| 10 | 10 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 return TRUE; | 179 return TRUE; |
| 180 } | 180 } |
| 181 | 181 |
| 182 CPDF_Object* CPDF_PageOrganizer::PageDictGetInheritableTag( | 182 CPDF_Object* CPDF_PageOrganizer::PageDictGetInheritableTag( |
| 183 CPDF_Dictionary* pDict, | 183 CPDF_Dictionary* pDict, |
| 184 CFX_ByteString nSrctag) { | 184 CFX_ByteString nSrctag) { |
| 185 if (!pDict || !pDict->KeyExist("Type") || nSrctag.IsEmpty()) | 185 if (!pDict || !pDict->KeyExist("Type") || nSrctag.IsEmpty()) |
| 186 return NULL; | 186 return NULL; |
| 187 | 187 |
| 188 CPDF_Object* pType = pDict->GetElement("Type")->GetDirect(); | 188 CPDF_Object* pType = pDict->GetElement("Type")->GetDirect(); |
| 189 if (!pType || pType->GetType() != PDFOBJ_NAME) | 189 if (!ToName(pType)) |
| 190 return NULL; | 190 return nullptr; |
|
dsinclair
2015/10/21 18:00:14
Merge conflict. I'm guessing due to the NULL vs nu
Tom Sepez
2015/10/21 19:41:04
Acknowledged.
| |
| 191 | |
| 192 if (pType->GetString().Compare("Page")) | 191 if (pType->GetString().Compare("Page")) |
| 193 return NULL; | 192 return NULL; |
| 194 if (!pDict->KeyExist("Parent")) | 193 if (!pDict->KeyExist("Parent")) |
| 195 return NULL; | 194 return NULL; |
| 196 | 195 |
| 197 CPDF_Dictionary* pp = ToDictionary(pDict->GetElement("Parent")->GetDirect()); | 196 CPDF_Dictionary* pp = ToDictionary(pDict->GetElement("Parent")->GetDirect()); |
| 198 if (!pp) | 197 if (!pp) |
| 199 return nullptr; | 198 return nullptr; |
| 200 | 199 |
| 201 if (pDict->KeyExist((const char*)nSrctag)) | 200 if (pDict->KeyExist((const char*)nSrctag)) |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 413 if (!pSrcDict) | 412 if (!pSrcDict) |
| 414 return FALSE; | 413 return FALSE; |
| 415 | 414 |
| 416 CPDF_Dictionary* pDstDict = pDstDoc->GetRoot(); | 415 CPDF_Dictionary* pDstDict = pDstDoc->GetRoot(); |
| 417 if (!pDstDict) | 416 if (!pDstDict) |
| 418 return FALSE; | 417 return FALSE; |
| 419 | 418 |
| 420 pDstDict->SetAt(FX_BSTRC("ViewerPreferences"), pSrcDict->Clone(TRUE)); | 419 pDstDict->SetAt(FX_BSTRC("ViewerPreferences"), pSrcDict->Clone(TRUE)); |
| 421 return TRUE; | 420 return TRUE; |
| 422 } | 421 } |
| OLD | NEW |