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

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

Issue 1419643005: Merge to XFA: Add type cast definitions for CPDF_Array. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
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
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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 CPDF_Reference* p = (CPDF_Reference*)pObj;
385 buf << " " << p->GetRefObjNum() << FX_BSTRC(" 0 R "); 385 buf << " " << p->GetRefObjNum() << FX_BSTRC(" 0 R ");
386 break; 386 break;
387 } 387 }
388 case PDFOBJ_ARRAY: { 388 case PDFOBJ_ARRAY: {
389 CPDF_Array* p = (CPDF_Array*)pObj; 389 const CPDF_Array* p = pObj->AsArray();
390 buf << FX_BSTRC("["); 390 buf << FX_BSTRC("[");
391 for (FX_DWORD i = 0; i < p->GetCount(); i++) { 391 for (FX_DWORD i = 0; i < p->GetCount(); i++) {
392 CPDF_Object* pElement = p->GetElement(i); 392 CPDF_Object* pElement = p->GetElement(i);
393 if (pElement->GetObjNum()) { 393 if (pElement->GetObjNum()) {
394 buf << " " << pElement->GetObjNum() << FX_BSTRC(" 0 R"); 394 buf << " " << pElement->GetObjNum() << FX_BSTRC(" 0 R");
395 } else { 395 } else {
396 buf << pElement; 396 buf << pElement;
397 } 397 }
398 } 398 }
399 buf << FX_BSTRC("]"); 399 buf << FX_BSTRC("]");
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 CPDF_Object* pFound = SearchNumberNode(pKid, num); 472 CPDF_Object* pFound = SearchNumberNode(pKid, num);
473 if (pFound) { 473 if (pFound) {
474 return pFound; 474 return pFound;
475 } 475 }
476 } 476 }
477 return NULL; 477 return NULL;
478 } 478 }
479 CPDF_Object* CPDF_NumberTree::LookupValue(int num) { 479 CPDF_Object* CPDF_NumberTree::LookupValue(int num) {
480 return SearchNumberNode(m_pRoot, num); 480 return SearchNumberNode(m_pRoot, num);
481 } 481 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698