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 "../../../include/fpdfapi/fpdf_parser.h" | 7 #include "../../../include/fpdfapi/fpdf_parser.h" |
8 const char PDF_CharType[256] = { | 8 const char PDF_CharType[256] = { |
9 // NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO | 9 // NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO |
10 // SI | 10 // SI |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 break; | 374 break; |
375 case PDFOBJ_STRING: | 375 case PDFOBJ_STRING: |
376 buf << PDF_EncodeString(pObj->GetString(), pObj->AsString()->IsHex()); | 376 buf << PDF_EncodeString(pObj->GetString(), pObj->AsString()->IsHex()); |
377 break; | 377 break; |
378 case PDFOBJ_NAME: { | 378 case PDFOBJ_NAME: { |
379 CFX_ByteString str = pObj->GetString(); | 379 CFX_ByteString str = pObj->GetString(); |
380 buf << FX_BSTRC("/") << PDF_NameEncode(str); | 380 buf << FX_BSTRC("/") << PDF_NameEncode(str); |
381 break; | 381 break; |
382 } | 382 } |
383 case PDFOBJ_REFERENCE: { | 383 case PDFOBJ_REFERENCE: { |
384 CPDF_Reference* p = (CPDF_Reference*)pObj; | 384 buf << " " << pObj->AsReference()->GetRefObjNum() << FX_BSTRC(" 0 R "); |
385 buf << " " << p->GetRefObjNum() << FX_BSTRC(" 0 R "); | |
386 break; | 385 break; |
387 } | 386 } |
388 case PDFOBJ_ARRAY: { | 387 case PDFOBJ_ARRAY: { |
389 const CPDF_Array* p = pObj->AsArray(); | 388 const CPDF_Array* p = pObj->AsArray(); |
390 buf << FX_BSTRC("["); | 389 buf << FX_BSTRC("["); |
391 for (FX_DWORD i = 0; i < p->GetCount(); i++) { | 390 for (FX_DWORD i = 0; i < p->GetCount(); i++) { |
392 CPDF_Object* pElement = p->GetElement(i); | 391 CPDF_Object* pElement = p->GetElement(i); |
393 if (pElement->GetObjNum()) { | 392 if (pElement->GetObjNum()) { |
394 buf << " " << pElement->GetObjNum() << FX_BSTRC(" 0 R"); | 393 buf << " " << pElement->GetObjNum() << FX_BSTRC(" 0 R"); |
395 } else { | 394 } else { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 CPDF_Object* pFound = SearchNumberNode(pKid, num); | 471 CPDF_Object* pFound = SearchNumberNode(pKid, num); |
473 if (pFound) { | 472 if (pFound) { |
474 return pFound; | 473 return pFound; |
475 } | 474 } |
476 } | 475 } |
477 return NULL; | 476 return NULL; |
478 } | 477 } |
479 CPDF_Object* CPDF_NumberTree::LookupValue(int num) { | 478 CPDF_Object* CPDF_NumberTree::LookupValue(int num) { |
480 return SearchNumberNode(m_pRoot, num); | 479 return SearchNumberNode(m_pRoot, num); |
481 } | 480 } |
OLD | NEW |