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

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

Issue 1418923005: Revert "Revert "Add type cast definitions for CPDF_Reference."" (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 1 month 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_form.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 "../../../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
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
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 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp ('k') | core/src/fpdfdoc/doc_form.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698