From f86ca3884886506c999a3b521078151e7cda0bf9 Mon Sep 17 00:00:00 2001 From: tsepez Date: Tue, 13 Sep 2016 12:23:30 -0700 Subject: Remove more strcmp/memcmp usage. Review-Url: https://codereview.chromium.org/2340513002 --- core/fpdfapi/fpdf_cmaps/cmap_int.h | 3 ++- core/fpdfapi/fpdf_cmaps/fpdf_cmaps.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'core/fpdfapi/fpdf_cmaps') diff --git a/core/fpdfapi/fpdf_cmaps/cmap_int.h b/core/fpdfapi/fpdf_cmaps/cmap_int.h index 685d6fe4b1..5735432371 100644 --- a/core/fpdfapi/fpdf_cmaps/cmap_int.h +++ b/core/fpdfapi/fpdf_cmaps/cmap_int.h @@ -7,6 +7,7 @@ #ifndef CORE_FPDFAPI_FPDF_CMAPS_CMAP_INT_H_ #define CORE_FPDFAPI_FPDF_CMAPS_CMAP_INT_H_ +#include "core/fxcrt/include/fx_string.h" #include "core/fxcrt/include/fx_system.h" struct FXCMAP_CMap { @@ -22,7 +23,7 @@ struct FXCMAP_CMap { int m_UseOffset; }; -void FPDFAPI_FindEmbeddedCMap(const char* name, +void FPDFAPI_FindEmbeddedCMap(const CFX_ByteString& name, int charset, int coding, const FXCMAP_CMap*& pMap); diff --git a/core/fpdfapi/fpdf_cmaps/fpdf_cmaps.cpp b/core/fpdfapi/fpdf_cmaps/fpdf_cmaps.cpp index 1e0250c1af..caf234badb 100644 --- a/core/fpdfapi/fpdf_cmaps/fpdf_cmaps.cpp +++ b/core/fpdfapi/fpdf_cmaps/fpdf_cmaps.cpp @@ -53,7 +53,7 @@ static int compareDWordSingle(const void* p1, const void* p2) { }; // extern "C" -void FPDFAPI_FindEmbeddedCMap(const char* name, +void FPDFAPI_FindEmbeddedCMap(const CFX_ByteString& bsName, int charset, int coding, const FXCMAP_CMap*& pMap) { @@ -64,10 +64,10 @@ void FPDFAPI_FindEmbeddedCMap(const char* name, pFontGlobals->m_EmbeddedCharsets[charset].m_pMapList; for (uint32_t i = 0; i < pFontGlobals->m_EmbeddedCharsets[charset].m_Count; i++) { - if (FXSYS_strcmp(name, pCMaps[i].m_Name)) - continue; - pMap = &pCMaps[i]; - break; + if (bsName == pCMaps[i].m_Name) { + pMap = &pCMaps[i]; + break; + } } } -- cgit v1.2.3