summaryrefslogtreecommitdiff
path: root/core/fpdfapi/font/cpdf_cidfont.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-08-10 17:18:09 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-10 17:18:09 +0000
commitef7c9553811c8b45ada69260e9abf5d4444bcd51 (patch)
tree348e0cd0bd70a20075223c6a93093c41dba63ace /core/fpdfapi/font/cpdf_cidfont.cpp
parent696a5293bb771d17c5f23b8ef73c0f961045ef30 (diff)
downloadpdfium-ef7c9553811c8b45ada69260e9abf5d4444bcd51.tar.xz
Consolidate const_casts<> in FXFT_Get_Name_Index()
There's a missing const in a qualifier in the third party FT library header, so rather than casting on every invocation, consolidate these into our wrapper macro. This may be easier to remove should the API ever get corrected. Part of the war on const_cast<>. Change-Id: I80cdb220730f40297e54aee10acc8bbd2c983b6d Reviewed-on: https://pdfium-review.googlesource.com/39850 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi/font/cpdf_cidfont.cpp')
-rw-r--r--core/fpdfapi/font/cpdf_cidfont.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/fpdfapi/font/cpdf_cidfont.cpp b/core/fpdfapi/font/cpdf_cidfont.cpp
index b73e0b8c56..cf2102cd8a 100644
--- a/core/fpdfapi/font/cpdf_cidfont.cpp
+++ b/core/fpdfapi/font/cpdf_cidfont.cpp
@@ -661,7 +661,7 @@ int CPDF_CIDFont::GlyphFromCharCode(uint32_t charcode, bool* pVertGlyph) {
uint32_t maccode =
FT_CharCodeFromUnicode(FXFT_ENCODING_APPLE_ROMAN, name_unicode);
index = maccode ? FXFT_Get_Char_Index(face, maccode)
- : FXFT_Get_Name_Index(face, const_cast<char*>(name));
+ : FXFT_Get_Name_Index(face, name);
}
if (index == 0 || index == 0xffff)
return charcode ? static_cast<int>(charcode) : -1;