OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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/cpdf_indirect_object_holder.h" | 7 #include "core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h" |
8 #include "core/include/fpdfapi/cpdf_object.h" | 8 |
9 #include "core/include/fpdfapi/cpdf_parser.h" | 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_object.h" |
| 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_parser.h" |
10 | 11 |
11 CPDF_IndirectObjectHolder::CPDF_IndirectObjectHolder(CPDF_Parser* pParser) | 12 CPDF_IndirectObjectHolder::CPDF_IndirectObjectHolder(CPDF_Parser* pParser) |
12 : m_pParser(pParser), m_LastObjNum(0) { | 13 : m_pParser(pParser), m_LastObjNum(0) { |
13 if (pParser) | 14 if (pParser) |
14 m_LastObjNum = m_pParser->GetLastObjNum(); | 15 m_LastObjNum = m_pParser->GetLastObjNum(); |
15 } | 16 } |
16 | 17 |
17 CPDF_IndirectObjectHolder::~CPDF_IndirectObjectHolder() { | 18 CPDF_IndirectObjectHolder::~CPDF_IndirectObjectHolder() { |
18 for (const auto& pair : m_IndirectObjs) | 19 for (const auto& pair : m_IndirectObjs) |
19 pair.second->Destroy(); | 20 pair.second->Destroy(); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 pObj->Destroy(); | 72 pObj->Destroy(); |
72 return FALSE; | 73 return FALSE; |
73 } | 74 } |
74 it->second->Destroy(); | 75 it->second->Destroy(); |
75 } | 76 } |
76 pObj->m_ObjNum = objnum; | 77 pObj->m_ObjNum = objnum; |
77 m_IndirectObjs[objnum] = pObj; | 78 m_IndirectObjs[objnum] = pObj; |
78 m_LastObjNum = std::max(m_LastObjNum, objnum); | 79 m_LastObjNum = std::max(m_LastObjNum, objnum); |
79 return TRUE; | 80 return TRUE; |
80 } | 81 } |
OLD | NEW |