Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Side by Side Diff: core/fpdfapi/page/fpdf_page_parser.cpp

Issue 2425783002: Revert "Make CPDF_Object containers hold objects via unique pointers." (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fpdfapi/page/cpdf_colorspace.cpp ('k') | core/fpdfapi/parser/cpdf_array.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « core/fpdfapi/page/cpdf_colorspace.cpp ('k') | core/fpdfapi/parser/cpdf_array.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698