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/include/fpdfapi/fpdf_parser.h" | 7 #include "core/include/fpdfapi/fpdf_parser.h" |
8 #include "core/include/fxcrt/fx_ext.h" | 8 #include "core/include/fxcrt/fx_ext.h" |
9 | 9 |
10 // Indexed by 8-bit character code, contains either: | 10 // Indexed by 8-bit character code, contains either: |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 } else { | 378 } else { |
379 buf << pElement; | 379 buf << pElement; |
380 } | 380 } |
381 } | 381 } |
382 buf << "]"; | 382 buf << "]"; |
383 break; | 383 break; |
384 } | 384 } |
385 case PDFOBJ_DICTIONARY: { | 385 case PDFOBJ_DICTIONARY: { |
386 const CPDF_Dictionary* p = pObj->AsDictionary(); | 386 const CPDF_Dictionary* p = pObj->AsDictionary(); |
387 buf << "<<"; | 387 buf << "<<"; |
388 FX_POSITION pos = p->GetStartPos(); | 388 for (const auto& it : *p) { |
389 while (pos) { | 389 const CFX_ByteString& key = it.first; |
390 CFX_ByteString key; | 390 CPDF_Object* pValue = it.second; |
391 CPDF_Object* pValue = p->GetNextElement(pos, key); | |
392 buf << "/" << PDF_NameEncode(key); | 391 buf << "/" << PDF_NameEncode(key); |
393 if (pValue && pValue->GetObjNum()) { | 392 if (pValue && pValue->GetObjNum()) { |
394 buf << " " << pValue->GetObjNum() << " 0 R "; | 393 buf << " " << pValue->GetObjNum() << " 0 R "; |
395 } else { | 394 } else { |
396 buf << pValue; | 395 buf << pValue; |
397 } | 396 } |
398 } | 397 } |
399 buf << ">>"; | 398 buf << ">>"; |
400 break; | 399 break; |
401 } | 400 } |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 CPDF_Object* pFound = SearchNumberNode(pKid, num); | 454 CPDF_Object* pFound = SearchNumberNode(pKid, num); |
456 if (pFound) { | 455 if (pFound) { |
457 return pFound; | 456 return pFound; |
458 } | 457 } |
459 } | 458 } |
460 return NULL; | 459 return NULL; |
461 } | 460 } |
462 CPDF_Object* CPDF_NumberTree::LookupValue(int num) { | 461 CPDF_Object* CPDF_NumberTree::LookupValue(int num) { |
463 return SearchNumberNode(m_pRoot, num); | 462 return SearchNumberNode(m_pRoot, num); |
464 } | 463 } |
OLD | NEW |