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 "core/include/fpdfapi/fpdf_objects.h" | 7 #include "core/include/fpdfapi/fpdf_objects.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 delete AsDictionary(); | 39 delete AsDictionary(); |
40 break; | 40 break; |
41 case PDFOBJ_STREAM: | 41 case PDFOBJ_STREAM: |
42 delete AsStream(); | 42 delete AsStream(); |
43 break; | 43 break; |
44 default: | 44 default: |
45 delete this; | 45 delete this; |
46 } | 46 } |
47 } | 47 } |
48 | 48 |
49 const CPDF_Object* const CPDF_Object::GetBasicObject() const { | 49 const CPDF_Object* CPDF_Object::GetBasicObject() const { |
50 const CPDF_Reference* pRef = AsReference(); | 50 const CPDF_Reference* pRef = AsReference(); |
51 if (!pRef) { | 51 if (!pRef) { |
52 // This is not an indirect reference. | 52 // This is not an indirect reference. |
53 return this; | 53 return this; |
54 } | 54 } |
55 if (!pRef->m_pObjList) | 55 if (!pRef->m_pObjList) |
56 return nullptr; | 56 return nullptr; |
57 return pRef->m_pObjList->GetIndirectObject(pRef->GetRefObjNum(), nullptr); | 57 return pRef->m_pObjList->GetIndirectObject(pRef->GetRefObjNum(), nullptr); |
58 } | 58 } |
59 | 59 |
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1098 pObj->Destroy(); | 1098 pObj->Destroy(); |
1099 return FALSE; | 1099 return FALSE; |
1100 } | 1100 } |
1101 it->second->Destroy(); | 1101 it->second->Destroy(); |
1102 } | 1102 } |
1103 pObj->m_ObjNum = objnum; | 1103 pObj->m_ObjNum = objnum; |
1104 m_IndirectObjs[objnum] = pObj; | 1104 m_IndirectObjs[objnum] = pObj; |
1105 m_LastObjNum = std::max(m_LastObjNum, objnum); | 1105 m_LastObjNum = std::max(m_LastObjNum, objnum); |
1106 return TRUE; | 1106 return TRUE; |
1107 } | 1107 } |
OLD | NEW |