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

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

Issue 2498223005: Make CPDF_Array take unique_ptrs (Closed)
Patch Set: nits Created 4 years, 1 month 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_image.cpp ('k') | core/fpdfapi/page/cpdf_streamparser.cpp » ('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 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/page/cpdf_streamcontentparser.h" 7 #include "core/fpdfapi/page/cpdf_streamcontentparser.h"
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 } 209 }
210 case CPDF_Object::ARRAY: { 210 case CPDF_Object::ARRAY: {
211 CPDF_Array* pArray = pObj->AsArray(); 211 CPDF_Array* pArray = pObj->AsArray();
212 for (size_t i = 0; i < pArray->GetCount(); i++) { 212 for (size_t i = 0; i < pArray->GetCount(); i++) {
213 CPDF_Object* pElement = pArray->GetObjectAt(i); 213 CPDF_Object* pElement = pArray->GetObjectAt(i);
214 if (pElement->IsName()) { 214 if (pElement->IsName()) {
215 CFX_ByteString name = pElement->GetString(); 215 CFX_ByteString name = pElement->GetString();
216 CFX_ByteStringC fullname = FindFullName( 216 CFX_ByteStringC fullname = FindFullName(
217 InlineValueAbbr, FX_ArraySize(InlineValueAbbr), name.AsStringC()); 217 InlineValueAbbr, FX_ArraySize(InlineValueAbbr), name.AsStringC());
218 if (!fullname.IsEmpty()) 218 if (!fullname.IsEmpty())
219 pArray->SetAt(i, new CPDF_Name(CFX_ByteString(fullname))); 219 pArray->SetNewAt<CPDF_Name>(i, CFX_ByteString(fullname));
220 } else { 220 } else {
221 ReplaceAbbr(pElement); 221 ReplaceAbbr(pElement);
222 } 222 }
223 } 223 }
224 break; 224 break;
225 } 225 }
226 default: 226 default:
227 break; 227 break;
228 } 228 }
229 } 229 }
(...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after
1661 } 1661 }
1662 default: 1662 default:
1663 bProcessed = false; 1663 bProcessed = false;
1664 } 1664 }
1665 if (!bProcessed) { 1665 if (!bProcessed) {
1666 m_pSyntax->SetPos(last_pos); 1666 m_pSyntax->SetPos(last_pos);
1667 return; 1667 return;
1668 } 1668 }
1669 } 1669 }
1670 } 1670 }
OLDNEW
« no previous file with comments | « core/fpdfapi/page/cpdf_image.cpp ('k') | core/fpdfapi/page/cpdf_streamparser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698