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

Side by Side Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp

Issue 1541703003: Use std::map as CPDF_Dictionary's underlying store. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments, rebase, fix embedder test Created 4 years, 11 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/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp ('k') | core/src/fpdfdoc/doc_action.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 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/include/fpdfapi/fpdf_parser.h" 7 #include "core/include/fpdfapi/fpdf_parser.h"
8 8
9 #include "core/include/fxcrt/fx_ext.h" 9 #include "core/include/fxcrt/fx_ext.h"
10 10
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 } else { 376 } else {
377 buf << pElement; 377 buf << pElement;
378 } 378 }
379 } 379 }
380 buf << "]"; 380 buf << "]";
381 break; 381 break;
382 } 382 }
383 case PDFOBJ_DICTIONARY: { 383 case PDFOBJ_DICTIONARY: {
384 const CPDF_Dictionary* p = pObj->AsDictionary(); 384 const CPDF_Dictionary* p = pObj->AsDictionary();
385 buf << "<<"; 385 buf << "<<";
386 FX_POSITION pos = p->GetStartPos(); 386 for (const auto& it : *p) {
387 while (pos) { 387 const CFX_ByteString& key = it.first;
388 CFX_ByteString key; 388 CPDF_Object* pValue = it.second;
389 CPDF_Object* pValue = p->GetNextElement(pos, key);
390 buf << "/" << PDF_NameEncode(key); 389 buf << "/" << PDF_NameEncode(key);
391 if (pValue && pValue->GetObjNum()) { 390 if (pValue && pValue->GetObjNum()) {
392 buf << " " << pValue->GetObjNum() << " 0 R "; 391 buf << " " << pValue->GetObjNum() << " 0 R ";
393 } else { 392 } else {
394 buf << pValue; 393 buf << pValue;
395 } 394 }
396 } 395 }
397 buf << ">>"; 396 buf << ">>";
398 break; 397 break;
399 } 398 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 CPDF_Object* pFound = SearchNumberNode(pKid, num); 452 CPDF_Object* pFound = SearchNumberNode(pKid, num);
454 if (pFound) { 453 if (pFound) {
455 return pFound; 454 return pFound;
456 } 455 }
457 } 456 }
458 return NULL; 457 return NULL;
459 } 458 }
460 CPDF_Object* CPDF_NumberTree::LookupValue(int num) { 459 CPDF_Object* CPDF_NumberTree::LookupValue(int num) {
461 return SearchNumberNode(m_pRoot, num); 460 return SearchNumberNode(m_pRoot, num);
462 } 461 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp ('k') | core/src/fpdfdoc/doc_action.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698