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/fpdfapi/fpdf_parser.h" | 7 #include "../../../include/fpdfapi/fpdf_parser.h" |
| 8 void CPDF_Object::Release() | 8 void CPDF_Object::Release() |
| 9 { | 9 { |
| 10 if (this == NULL) { | 10 if (this == NULL) { |
| (...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1323 ((CPDF_Object*)value)->Destroy(); | 1323 ((CPDF_Object*)value)->Destroy(); |
| 1324 m_IndirectObjs.RemoveKey((FX_LPVOID)(FX_UINTPTR)objnum); | 1324 m_IndirectObjs.RemoveKey((FX_LPVOID)(FX_UINTPTR)objnum); |
| 1325 } | 1325 } |
| 1326 void CPDF_IndirectObjects::InsertIndirectObject(FX_DWORD objnum, CPDF_Object* pO bj) | 1326 void CPDF_IndirectObjects::InsertIndirectObject(FX_DWORD objnum, CPDF_Object* pO bj) |
| 1327 { | 1327 { |
| 1328 if (objnum == 0 || pObj == NULL) { | 1328 if (objnum == 0 || pObj == NULL) { |
| 1329 return; | 1329 return; |
| 1330 } | 1330 } |
| 1331 FX_LPVOID value; | 1331 FX_LPVOID value; |
| 1332 if (m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, value)) { | 1332 if (m_IndirectObjs.Lookup((FX_LPVOID)(FX_UINTPTR)objnum, value)) { |
| 1333 ((CPDF_Object*)value)->Destroy(); | 1333 return; |
|
palmer
2014/06/25 23:21:44
But the caller is going to expect that this functi
| |
| 1334 } | 1334 } |
| 1335 pObj->m_ObjNum = objnum; | 1335 pObj->m_ObjNum = objnum; |
| 1336 m_IndirectObjs.SetAt((FX_LPVOID)(FX_UINTPTR)objnum, pObj); | 1336 m_IndirectObjs.SetAt((FX_LPVOID)(FX_UINTPTR)objnum, pObj); |
| 1337 if (m_LastObjNum < objnum) { | 1337 if (m_LastObjNum < objnum) { |
| 1338 m_LastObjNum = objnum; | 1338 m_LastObjNum = objnum; |
| 1339 } | 1339 } |
| 1340 } | 1340 } |
| 1341 FX_DWORD CPDF_IndirectObjects::GetLastObjNum() const | 1341 FX_DWORD CPDF_IndirectObjects::GetLastObjNum() const |
| 1342 { | 1342 { |
| 1343 return m_LastObjNum; | 1343 return m_LastObjNum; |
| 1344 } | 1344 } |
| OLD | NEW |