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 | 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 Loading... |
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 Loading... |
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 } |
OLD | NEW |