summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_cmaps
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-09-13 12:23:30 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-13 12:23:30 -0700
commitf86ca3884886506c999a3b521078151e7cda0bf9 (patch)
tree691e3fe357541698159f3ca903a85461e20a43f0 /core/fpdfapi/fpdf_cmaps
parentf34518bd1379289659b4c050d140690ba8f8b8aa (diff)
downloadpdfium-f86ca3884886506c999a3b521078151e7cda0bf9.tar.xz
Remove more strcmp/memcmp usage.
Review-Url: https://codereview.chromium.org/2340513002
Diffstat (limited to 'core/fpdfapi/fpdf_cmaps')
-rw-r--r--core/fpdfapi/fpdf_cmaps/cmap_int.h3
-rw-r--r--core/fpdfapi/fpdf_cmaps/fpdf_cmaps.cpp10
2 files changed, 7 insertions, 6 deletions
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;
+ }
}
}