summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_font
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_font
parentf34518bd1379289659b4c050d140690ba8f8b8aa (diff)
downloadpdfium-f86ca3884886506c999a3b521078151e7cda0bf9.tar.xz
Remove more strcmp/memcmp usage.
Review-Url: https://codereview.chromium.org/2340513002
Diffstat (limited to 'core/fpdfapi/fpdf_font')
-rw-r--r--core/fpdfapi/fpdf_font/font_int.h2
-rw-r--r--core/fpdfapi/fpdf_font/fpdf_font_cid.cpp26
2 files changed, 14 insertions, 14 deletions
diff --git a/core/fpdfapi/fpdf_font/font_int.h b/core/fpdfapi/fpdf_font/font_int.h
index a09bb6bce6..e4689bfd74 100644
--- a/core/fpdfapi/fpdf_font/font_int.h
+++ b/core/fpdfapi/fpdf_font/font_int.h
@@ -139,7 +139,7 @@ class CPDF_CMap {
~CPDF_CMap();
FX_BOOL LoadPredefined(CPDF_CMapManager* pMgr,
- const FX_CHAR* name,
+ const CFX_ByteString& name,
FX_BOOL bPromptCJK);
FX_BOOL LoadEmbedded(const uint8_t* pData, uint32_t dwSize);
diff --git a/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
index d8cada7af3..457f8eec3e 100644
--- a/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
+++ b/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
@@ -315,10 +315,9 @@ CPDF_CMap* CPDF_CMapManager::LoadPredefinedCMap(const CFX_ByteString& name,
}
void CPDF_CMapManager::ReloadAll() {
- for (const auto& pair : m_CMaps) {
- CPDF_CMap* pCMap = pair.second;
- pCMap->LoadPredefined(this, pair.first.c_str(), FALSE);
- }
+ for (const auto& pair : m_CMaps)
+ pair.second->LoadPredefined(this, pair.first, FALSE);
+
for (size_t i = 0; i < FX_ArraySize(m_CID2UnicodeMaps); ++i) {
if (CPDF_CID2UnicodeMap* pMap = m_CID2UnicodeMaps[i]) {
pMap->Load(this, CIDSetFromSizeT(i), FALSE);
@@ -528,12 +527,12 @@ FX_BOOL CPDF_CMap::IsVertWriting() const {
}
FX_BOOL CPDF_CMap::LoadPredefined(CPDF_CMapManager* pMgr,
- const FX_CHAR* pName,
+ const CFX_ByteString& bsName,
FX_BOOL bPromptCJK) {
- m_PredefinedCMap = pName;
+ m_PredefinedCMap = bsName;
if (m_PredefinedCMap == "Identity-H" || m_PredefinedCMap == "Identity-V") {
m_Coding = CIDCODING_CID;
- m_bVertical = pName[9] == 'V';
+ m_bVertical = bsName[9] == 'V';
m_bLoaded = TRUE;
return TRUE;
}
@@ -564,13 +563,14 @@ FX_BOOL CPDF_CMap::LoadPredefined(CPDF_CMapManager* pMgr,
}
}
}
- FPDFAPI_FindEmbeddedCMap(pName, m_Charset, m_Coding, m_pEmbedMap);
- if (m_pEmbedMap) {
- m_bLoaded = TRUE;
- return TRUE;
- }
- return FALSE;
+ FPDFAPI_FindEmbeddedCMap(bsName, m_Charset, m_Coding, m_pEmbedMap);
+ if (!m_pEmbedMap)
+ return FALSE;
+
+ m_bLoaded = TRUE;
+ return TRUE;
}
+
FX_BOOL CPDF_CMap::LoadEmbedded(const uint8_t* pData, uint32_t size) {
m_pMapping = FX_Alloc(uint16_t, 65536);
CPDF_CMapParser parser;