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

Unified Diff: core/src/fxge/apple/fx_mac_imp.cpp

Issue 1301793002: Merge to XFA: CFX_MapByteStringToPtr considered harmful (combo patch). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 4 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/src/fxcrt/fx_basic_maps.cpp ('k') | core/src/fxge/ge/fx_ge_fontmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxge/apple/fx_mac_imp.cpp
diff --git a/core/src/fxge/apple/fx_mac_imp.cpp b/core/src/fxge/apple/fx_mac_imp.cpp
index e08f6224d83edb59651e1ebb0575ff0aeedcdf34..88a51bd78cfa6cddbe8546f3a566856f084a2164 100644
--- a/core/src/fxge/apple/fx_mac_imp.cpp
+++ b/core/src/fxge/apple/fx_mac_imp.cpp
@@ -65,10 +65,10 @@ void* CFX_MacFontInfo::MapFont(int weight,
if (iBaseFont < 12) {
return GetFont(face);
}
- void* p;
- if (m_FontList.Lookup(face, p)) {
- return p;
- }
+ auto it = m_FontList.find(face);
+ if (it != m_FontList.end())
+ return it->second;
+
if (charset == FXFONT_ANSI_CHARSET && (pitch_family & FXFONT_FF_FIXEDPITCH)) {
return GetFont("Courier New");
}
@@ -88,9 +88,10 @@ void* CFX_MacFontInfo::MapFont(int weight,
case FXFONT_CHINESEBIG5_CHARSET:
face = "LiSong Pro Light";
}
- if (m_FontList.Lookup(face, p)) {
- return p;
- }
+ it = m_FontList.find(face);
+ if (it != m_FontList.end())
+ return it->second;
+
return NULL;
}
IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault() {
« no previous file with comments | « core/src/fxcrt/fx_basic_maps.cpp ('k') | core/src/fxge/ge/fx_ge_fontmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698