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 <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 3789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3800 if (!bNumber) { | 3800 if (!bNumber) { |
3801 return -1; | 3801 return -1; |
3802 } | 3802 } |
3803 FX_DWORD objNum = FXSYS_atoi(objnum); | 3803 FX_DWORD objNum = FXSYS_atoi(objnum); |
3804 CPDF_Object* pObj = m_parser.ParseIndirectObjectAt(NULL, 0, objNum, NULL); | 3804 CPDF_Object* pObj = m_parser.ParseIndirectObjectAt(NULL, 0, objNum, NULL); |
3805 if (!pObj) { | 3805 if (!pObj) { |
3806 m_Pos += m_parser.m_Syntax.SavePos(); | 3806 m_Pos += m_parser.m_Syntax.SavePos(); |
3807 return 0; | 3807 return 0; |
3808 } | 3808 } |
3809 CPDF_Dictionary* pDict = pObj->GetDict(); | 3809 CPDF_Dictionary* pDict = pObj->GetDict(); |
3810 CPDF_Object* pName = pDict ? pDict->GetElement(FX_BSTRC("Type")) : NULL; | 3810 CPDF_Name* pName = |
3811 if (pName && pName->GetType() == PDFOBJ_NAME) { | 3811 ToName(pDict ? pDict->GetElement(FX_BSTRC("Type")) : nullptr); |
| 3812 if (pName) { |
3812 if (pName->GetString() == FX_BSTRC("XRef")) { | 3813 if (pName->GetString() == FX_BSTRC("XRef")) { |
3813 m_Pos += m_parser.m_Syntax.SavePos(); | 3814 m_Pos += m_parser.m_Syntax.SavePos(); |
3814 xref_offset = pObj->GetDict()->GetInteger(FX_BSTRC("Prev")); | 3815 xref_offset = pObj->GetDict()->GetInteger(FX_BSTRC("Prev")); |
3815 pObj->Release(); | 3816 pObj->Release(); |
3816 return 1; | 3817 return 1; |
3817 } | 3818 } |
3818 } | 3819 } |
3819 pObj->Release(); | 3820 pObj->Release(); |
3820 return -1; | 3821 return -1; |
3821 } | 3822 } |
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4615 return FALSE; | 4616 return FALSE; |
4616 } | 4617 } |
4617 CPDF_PageNode::~CPDF_PageNode() { | 4618 CPDF_PageNode::~CPDF_PageNode() { |
4618 int32_t iSize = m_childNode.GetSize(); | 4619 int32_t iSize = m_childNode.GetSize(); |
4619 for (int32_t i = 0; i < iSize; ++i) { | 4620 for (int32_t i = 0; i < iSize; ++i) { |
4620 CPDF_PageNode* pNode = (CPDF_PageNode*)m_childNode[i]; | 4621 CPDF_PageNode* pNode = (CPDF_PageNode*)m_childNode[i]; |
4621 delete pNode; | 4622 delete pNode; |
4622 } | 4623 } |
4623 m_childNode.RemoveAll(); | 4624 m_childNode.RemoveAll(); |
4624 } | 4625 } |
OLD | NEW |