| 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 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 844 if (!pRoot || | 844 if (!pRoot || |
| 845 (pRef && | 845 (pRef && |
| 846 (FX_DWORD)m_CrossRef.GetSize() > | 846 (FX_DWORD)m_CrossRef.GetSize() > |
| 847 pRef->GetRefObjNum() && | 847 pRef->GetRefObjNum() && |
| 848 m_CrossRef.GetAt(pRef->GetRefObjNum()) != 0)) { | 848 m_CrossRef.GetAt(pRef->GetRefObjNum()) != 0)) { |
| 849 FX_POSITION pos = pTrailer->GetStartPos(); | 849 FX_POSITION pos = pTrailer->GetStartPos(); |
| 850 while (pos) { | 850 while (pos) { |
| 851 CFX_ByteString key; | 851 CFX_ByteString key; |
| 852 CPDF_Object* pElement = | 852 CPDF_Object* pElement = |
| 853 pTrailer->GetNextElement(pos, key); | 853 pTrailer->GetNextElement(pos, key); |
| 854 FX_DWORD dwObjNum = pElement->GetObjNum(); | 854 FX_DWORD dwObjNum = |
| 855 pElement ? pElement->GetObjNum() : 0; |
| 855 if (dwObjNum) { | 856 if (dwObjNum) { |
| 856 m_pTrailer->SetAtReference(key, m_pDocument, | 857 m_pTrailer->SetAtReference(key, m_pDocument, |
| 857 dwObjNum); | 858 dwObjNum); |
| 858 } else { | 859 } else { |
| 859 m_pTrailer->SetAt(key, pElement->Clone()); | 860 m_pTrailer->SetAt(key, pElement->Clone()); |
| 860 } | 861 } |
| 861 } | 862 } |
| 862 pObj->Release(); | 863 pObj->Release(); |
| 863 } else { | 864 } else { |
| 864 pObj->Release(); | 865 pObj->Release(); |
| (...skipping 3665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4530 return FALSE; | 4531 return FALSE; |
| 4531 } | 4532 } |
| 4532 CPDF_PageNode::~CPDF_PageNode() { | 4533 CPDF_PageNode::~CPDF_PageNode() { |
| 4533 int32_t iSize = m_childNode.GetSize(); | 4534 int32_t iSize = m_childNode.GetSize(); |
| 4534 for (int32_t i = 0; i < iSize; ++i) { | 4535 for (int32_t i = 0; i < iSize; ++i) { |
| 4535 CPDF_PageNode* pNode = (CPDF_PageNode*)m_childNode[i]; | 4536 CPDF_PageNode* pNode = (CPDF_PageNode*)m_childNode[i]; |
| 4536 delete pNode; | 4537 delete pNode; |
| 4537 } | 4538 } |
| 4538 m_childNode.RemoveAll(); | 4539 m_childNode.RemoveAll(); |
| 4539 } | 4540 } |
| OLD | NEW |