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/fpdfapi/page/pageint.h" | 7 #include "core/fpdfapi/page/pageint.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 FX_ArraySize(PDF_InlineValueAbbr), abbr); | 90 FX_ArraySize(PDF_InlineValueAbbr), abbr); |
91 } | 91 } |
92 | 92 |
93 void PDF_ReplaceAbbr(CPDF_Object* pObj) { | 93 void PDF_ReplaceAbbr(CPDF_Object* pObj) { |
94 switch (pObj->GetType()) { | 94 switch (pObj->GetType()) { |
95 case CPDF_Object::DICTIONARY: { | 95 case CPDF_Object::DICTIONARY: { |
96 CPDF_Dictionary* pDict = pObj->AsDictionary(); | 96 CPDF_Dictionary* pDict = pObj->AsDictionary(); |
97 std::vector<AbbrReplacementOp> replacements; | 97 std::vector<AbbrReplacementOp> replacements; |
98 for (const auto& it : *pDict) { | 98 for (const auto& it : *pDict) { |
99 CFX_ByteString key = it.first; | 99 CFX_ByteString key = it.first; |
100 CPDF_Object* value = it.second.get(); | 100 CPDF_Object* value = it.second; |
101 CFX_ByteStringC fullname = | 101 CFX_ByteStringC fullname = |
102 PDF_FindFullName(PDF_InlineKeyAbbr, FX_ArraySize(PDF_InlineKeyAbbr), | 102 PDF_FindFullName(PDF_InlineKeyAbbr, FX_ArraySize(PDF_InlineKeyAbbr), |
103 key.AsStringC()); | 103 key.AsStringC()); |
104 if (!fullname.IsEmpty()) { | 104 if (!fullname.IsEmpty()) { |
105 AbbrReplacementOp op; | 105 AbbrReplacementOp op; |
106 op.is_replace_key = true; | 106 op.is_replace_key = true; |
107 op.key = key; | 107 op.key = key; |
108 op.replacement = fullname; | 108 op.replacement = fullname; |
109 replacements.push_back(op); | 109 replacements.push_back(op); |
110 key = fullname; | 110 key = fullname; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 } else { | 149 } else { |
150 PDF_ReplaceAbbr(pElement); | 150 PDF_ReplaceAbbr(pElement); |
151 } | 151 } |
152 } | 152 } |
153 break; | 153 break; |
154 } | 154 } |
155 default: | 155 default: |
156 break; | 156 break; |
157 } | 157 } |
158 } | 158 } |
OLD | NEW |