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

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

Issue 1410343003: [Merge to XFA] Revert "Revert "Add type cast definitions for CPDF_Dictionary."" (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Rebase to origin/xfa 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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 if (pElement->GetObjNum()) { 396 if (pElement->GetObjNum()) {
397 buf << " " << pElement->GetObjNum() << FX_BSTRC(" 0 R"); 397 buf << " " << pElement->GetObjNum() << FX_BSTRC(" 0 R");
398 } else { 398 } else {
399 buf << pElement; 399 buf << pElement;
400 } 400 }
401 } 401 }
402 buf << FX_BSTRC("]"); 402 buf << FX_BSTRC("]");
403 break; 403 break;
404 } 404 }
405 case PDFOBJ_DICTIONARY: { 405 case PDFOBJ_DICTIONARY: {
406 CPDF_Dictionary* p = (CPDF_Dictionary*)pObj; 406 const CPDF_Dictionary* p = pObj->AsDictionary();
407 buf << FX_BSTRC("<<"); 407 buf << FX_BSTRC("<<");
408 FX_POSITION pos = p->GetStartPos(); 408 FX_POSITION pos = p->GetStartPos();
409 while (pos) { 409 while (pos) {
410 CFX_ByteString key; 410 CFX_ByteString key;
411 CPDF_Object* pValue = p->GetNextElement(pos, key); 411 CPDF_Object* pValue = p->GetNextElement(pos, key);
412 buf << FX_BSTRC("/") << PDF_NameEncode(key); 412 buf << FX_BSTRC("/") << PDF_NameEncode(key);
413 if (pValue && pValue->GetObjNum()) { 413 if (pValue && pValue->GetObjNum()) {
414 buf << " " << pValue->GetObjNum() << FX_BSTRC(" 0 R "); 414 buf << " " << pValue->GetObjNum() << FX_BSTRC(" 0 R ");
415 } else { 415 } else {
416 buf << pValue; 416 buf << pValue;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 CPDF_Object* pFound = SearchNumberNode(pKid, num); 475 CPDF_Object* pFound = SearchNumberNode(pKid, num);
476 if (pFound) { 476 if (pFound) {
477 return pFound; 477 return pFound;
478 } 478 }
479 } 479 }
480 return NULL; 480 return NULL;
481 } 481 }
482 CPDF_Object* CPDF_NumberTree::LookupValue(int num) { 482 CPDF_Object* CPDF_NumberTree::LookupValue(int num) {
483 return SearchNumberNode(m_pRoot, num); 483 return SearchNumberNode(m_pRoot, num);
484 } 484 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp ('k') | core/src/fpdfapi/fpdf_render/fpdf_render.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698