Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: core/fpdfapi/fpdf_font/fpdf_font_cid.cpp

Issue 2340513002: Remove more strcmp/memcmp usage. (Closed)
Patch Set: Nit Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/fpdf_font/font_int.h ('k') | fpdfsdk/fpdfppo.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
diff --git a/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
index d8cada7af31bbe6f077f83f96696693088a1fdab..457f8eec3ed849182c9428a0e3031d61e2705c98 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;
« no previous file with comments | « core/fpdfapi/fpdf_font/font_int.h ('k') | fpdfsdk/fpdfppo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698