| 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/fpdfapi/fpdf_parser/include/cpdf_parser.h" | 7 #include "core/fpdfapi/fpdf_parser/include/cpdf_parser.h" |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 (pRef && IsValidObjectNumber(pRef->GetRefObjNum()) && | 815 (pRef && IsValidObjectNumber(pRef->GetRefObjNum()) && |
| 816 m_ObjectInfo[pRef->GetRefObjNum()].pos != 0)) { | 816 m_ObjectInfo[pRef->GetRefObjNum()].pos != 0)) { |
| 817 auto it = pTrailer->begin(); | 817 auto it = pTrailer->begin(); |
| 818 while (it != pTrailer->end()) { | 818 while (it != pTrailer->end()) { |
| 819 const CFX_ByteString& key = it->first; | 819 const CFX_ByteString& key = it->first; |
| 820 CPDF_Object* pElement = it->second; | 820 CPDF_Object* pElement = it->second; |
| 821 ++it; | 821 ++it; |
| 822 uint32_t dwObjNum = | 822 uint32_t dwObjNum = |
| 823 pElement ? pElement->GetObjNum() : 0; | 823 pElement ? pElement->GetObjNum() : 0; |
| 824 if (dwObjNum) { | 824 if (dwObjNum) { |
| 825 m_pTrailer->SetAtReference(key, m_pDocument, | 825 m_pTrailer->SetAtReference(key.AsByteStringC(), |
| 826 dwObjNum); | 826 m_pDocument, dwObjNum); |
| 827 } else { | 827 } else { |
| 828 m_pTrailer->SetAt(key, pElement->Clone()); | 828 m_pTrailer->SetAt(key.AsByteStringC(), |
| 829 pElement->Clone()); |
| 829 } | 830 } |
| 830 } | 831 } |
| 831 } | 832 } |
| 832 pObj->Release(); | 833 pObj->Release(); |
| 833 } else { | 834 } else { |
| 834 if (pObj->IsStream()) { | 835 if (pObj->IsStream()) { |
| 835 m_pTrailer = ToDictionary(pTrailer->Clone()); | 836 m_pTrailer = ToDictionary(pTrailer->Clone()); |
| 836 pObj->Release(); | 837 pObj->Release(); |
| 837 } else { | 838 } else { |
| 838 m_pTrailer = pTrailer; | 839 m_pTrailer = pTrailer; |
| (...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1643 if (!LoadLinearizedAllCrossRefV4(m_LastXRefOffset, m_dwXrefStartObjNum) && | 1644 if (!LoadLinearizedAllCrossRefV4(m_LastXRefOffset, m_dwXrefStartObjNum) && |
| 1644 !LoadLinearizedAllCrossRefV5(m_LastXRefOffset)) { | 1645 !LoadLinearizedAllCrossRefV5(m_LastXRefOffset)) { |
| 1645 m_LastXRefOffset = 0; | 1646 m_LastXRefOffset = 0; |
| 1646 m_pSyntax->m_MetadataObjnum = dwSaveMetadataObjnum; | 1647 m_pSyntax->m_MetadataObjnum = dwSaveMetadataObjnum; |
| 1647 return FORMAT_ERROR; | 1648 return FORMAT_ERROR; |
| 1648 } | 1649 } |
| 1649 | 1650 |
| 1650 m_pSyntax->m_MetadataObjnum = dwSaveMetadataObjnum; | 1651 m_pSyntax->m_MetadataObjnum = dwSaveMetadataObjnum; |
| 1651 return SUCCESS; | 1652 return SUCCESS; |
| 1652 } | 1653 } |
| OLD | NEW |