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

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

Issue 1417033004: Merge to XFA: Add type cast definitions for CPDF_Name. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 2 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
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 "../../../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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 return buf; 365 return buf;
366 } 366 }
367 switch (pObj->GetType()) { 367 switch (pObj->GetType()) {
368 case PDFOBJ_NULL: 368 case PDFOBJ_NULL:
369 buf << FX_BSTRC(" null"); 369 buf << FX_BSTRC(" null");
370 break; 370 break;
371 case PDFOBJ_BOOLEAN: 371 case PDFOBJ_BOOLEAN:
372 case PDFOBJ_NUMBER: 372 case PDFOBJ_NUMBER:
373 buf << " " << pObj->GetString(); 373 buf << " " << pObj->GetString();
374 break; 374 break;
375 case PDFOBJ_STRING: { 375 case PDFOBJ_STRING:
376 CFX_ByteString str = pObj->GetString(); 376 buf << PDF_EncodeString(pObj->GetString(), pObj->AsString()->IsHex());
377 FX_BOOL bHex = pObj->AsString()->IsHex();
378 buf << PDF_EncodeString(str, bHex);
379 break; 377 break;
380 }
381 case PDFOBJ_NAME: { 378 case PDFOBJ_NAME: {
382 CFX_ByteString str = pObj->GetString(); 379 CFX_ByteString str = pObj->GetString();
383 buf << FX_BSTRC("/") << PDF_NameEncode(str); 380 buf << FX_BSTRC("/") << PDF_NameEncode(str);
384 break; 381 break;
385 } 382 }
386 case PDFOBJ_REFERENCE: { 383 case PDFOBJ_REFERENCE: {
387 CPDF_Reference* p = (CPDF_Reference*)pObj; 384 CPDF_Reference* p = (CPDF_Reference*)pObj;
388 buf << " " << p->GetRefObjNum() << FX_BSTRC(" 0 R "); 385 buf << " " << p->GetRefObjNum() << FX_BSTRC(" 0 R ");
389 break; 386 break;
390 } 387 }
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 CPDF_Object* pFound = SearchNumberNode(pKid, num); 472 CPDF_Object* pFound = SearchNumberNode(pKid, num);
476 if (pFound) { 473 if (pFound) {
477 return pFound; 474 return pFound;
478 } 475 }
479 } 476 }
480 return NULL; 477 return NULL;
481 } 478 }
482 CPDF_Object* CPDF_NumberTree::LookupValue(int num) { 479 CPDF_Object* CPDF_NumberTree::LookupValue(int num) {
483 return SearchNumberNode(m_pRoot, num); 480 return SearchNumberNode(m_pRoot, num);
484 } 481 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698