summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/fpdfapi/fpdf_font/cpdf_type1font.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/core/fpdfapi/fpdf_font/cpdf_type1font.cpp b/core/fpdfapi/fpdf_font/cpdf_type1font.cpp
index 908b6e3a2f..3f1b5d1a40 100644
--- a/core/fpdfapi/fpdf_font/cpdf_type1font.cpp
+++ b/core/fpdfapi/fpdf_font/cpdf_type1font.cpp
@@ -23,24 +23,21 @@ struct GlyphNameMap {
};
const GlyphNameMap g_GlyphNameSubsts[] = {{"ff", "uniFB00"},
- {"fi", "uniFB01"},
- {"fl", "uniFB02"},
{"ffi", "uniFB03"},
- {"ffl", "uniFB04"}};
+ {"ffl", "uniFB04"},
+ {"fi", "uniFB01"},
+ {"fl", "uniFB02"}};
int compareString(const void* key, const void* element) {
- return FXSYS_stricmp((const FX_CHAR*)key,
- ((GlyphNameMap*)element)->m_pStrAdobe);
+ return FXSYS_stricmp(static_cast<const FX_CHAR*>(key),
+ static_cast<const GlyphNameMap*>(element)->m_pStrAdobe);
}
const FX_CHAR* GlyphNameRemap(const FX_CHAR* pStrAdobe) {
- GlyphNameMap* found = (GlyphNameMap*)FXSYS_bsearch(
- pStrAdobe, g_GlyphNameSubsts,
- sizeof(g_GlyphNameSubsts) / sizeof(GlyphNameMap), sizeof(GlyphNameMap),
- compareString);
- if (found)
- return found->m_pStrUnicode;
- return nullptr;
+ const GlyphNameMap* found = static_cast<const GlyphNameMap*>(FXSYS_bsearch(
+ pStrAdobe, g_GlyphNameSubsts, FX_ArraySize(g_GlyphNameSubsts),
+ sizeof(GlyphNameMap), compareString));
+ return found ? found->m_pStrUnicode : nullptr;
}
#endif // _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_