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

Side by Side Diff: core/fpdfapi/fpdf_font/cpdf_font.cpp

Issue 1841173002: Rename GetElementValue() to GetDirectObject{By,At}(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Fix test name Created 4 years, 8 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
« no previous file with comments | « core/fpdfapi/fpdf_font/cpdf_cidfont.cpp ('k') | core/fpdfapi/fpdf_font/cpdf_simplefont.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 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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 "core/fpdfapi/fpdf_font/include/cpdf_font.h" 7 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h"
8 8
9 #include "core/fpdfapi/fpdf_font/cpdf_truetypefont.h" 9 #include "core/fpdfapi/fpdf_font/cpdf_truetypefont.h"
10 #include "core/fpdfapi/fpdf_font/cpdf_type1font.h" 10 #include "core/fpdfapi/fpdf_font/cpdf_type1font.h"
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 if ((!bEmbedded || bTrueType) && iBaseEncoding == PDFFONT_ENCODING_BUILTIN) { 445 if ((!bEmbedded || bTrueType) && iBaseEncoding == PDFFONT_ENCODING_BUILTIN) {
446 iBaseEncoding = PDFFONT_ENCODING_STANDARD; 446 iBaseEncoding = PDFFONT_ENCODING_STANDARD;
447 } 447 }
448 CPDF_Array* pDiffs = pDict->GetArrayBy("Differences"); 448 CPDF_Array* pDiffs = pDict->GetArrayBy("Differences");
449 if (!pDiffs) { 449 if (!pDiffs) {
450 return; 450 return;
451 } 451 }
452 pCharNames = new CFX_ByteString[256]; 452 pCharNames = new CFX_ByteString[256];
453 uint32_t cur_code = 0; 453 uint32_t cur_code = 0;
454 for (uint32_t i = 0; i < pDiffs->GetCount(); i++) { 454 for (uint32_t i = 0; i < pDiffs->GetCount(); i++) {
455 CPDF_Object* pElement = pDiffs->GetElementValue(i); 455 CPDF_Object* pElement = pDiffs->GetDirectObjectAt(i);
456 if (!pElement) 456 if (!pElement)
457 continue; 457 continue;
458 458
459 if (CPDF_Name* pName = pElement->AsName()) { 459 if (CPDF_Name* pName = pElement->AsName()) {
460 if (cur_code < 256) 460 if (cur_code < 256)
461 pCharNames[cur_code] = pName->GetString(); 461 pCharNames[cur_code] = pName->GetString();
462 cur_code++; 462 cur_code++;
463 } else { 463 } else {
464 cur_code = pElement->GetInteger(); 464 cur_code = pElement->GetInteger();
465 } 465 }
(...skipping 17 matching lines...) Expand all
483 if (charcode < 0 || charcode >= 256) 483 if (charcode < 0 || charcode >= 256)
484 return nullptr; 484 return nullptr;
485 485
486 const FX_CHAR* name = nullptr; 486 const FX_CHAR* name = nullptr;
487 if (pCharNames) 487 if (pCharNames)
488 name = pCharNames[charcode]; 488 name = pCharNames[charcode];
489 if ((!name || name[0] == 0) && iBaseEncoding) 489 if ((!name || name[0] == 0) && iBaseEncoding)
490 name = PDF_CharNameFromPredefinedCharSet(iBaseEncoding, charcode); 490 name = PDF_CharNameFromPredefinedCharSet(iBaseEncoding, charcode);
491 return name && name[0] ? name : nullptr; 491 return name && name[0] ? name : nullptr;
492 } 492 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_font/cpdf_cidfont.cpp ('k') | core/fpdfapi/fpdf_font/cpdf_simplefont.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698