summaryrefslogtreecommitdiff
path: root/core/fxge
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-13 15:41:21 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-13 15:41:21 -0700
commitb4c9f3f04673753da30011e9f1282cd5d1fa0f40 (patch)
tree9890d43409c8d60b1041de921c961067907419fb /core/fxge
parentcdce75706de7e76e73550a0582e1fd28af324fd0 (diff)
downloadpdfium-b4c9f3f04673753da30011e9f1282cd5d1fa0f40.tar.xz
Remove implicit cast from CFX_ByteString to (const char*).
BUG= Review URL: https://codereview.chromium.org/1885973002
Diffstat (limited to 'core/fxge')
-rw-r--r--core/fxge/apple/fx_mac_imp.cpp2
-rw-r--r--core/fxge/ge/fx_ge_fontmap.cpp26
-rw-r--r--core/fxge/win32/fx_win32_device.cpp7
-rw-r--r--core/fxge/win32/fx_win32_gdipext.cpp2
4 files changed, 19 insertions, 18 deletions
diff --git a/core/fxge/apple/fx_mac_imp.cpp b/core/fxge/apple/fx_mac_imp.cpp
index aae3f71b39..82b5078565 100644
--- a/core/fxge/apple/fx_mac_imp.cpp
+++ b/core/fxge/apple/fx_mac_imp.cpp
@@ -64,7 +64,7 @@ void* CFX_MacFontInfo::MapFont(int weight,
break;
}
if (iBaseFont < 12) {
- return GetFont(face);
+ return GetFont(face.c_str());
}
auto it = m_FontList.find(face);
if (it != m_FontList.end())
diff --git a/core/fxge/ge/fx_ge_fontmap.cpp b/core/fxge/ge/fx_ge_fontmap.cpp
index 8f9dad837e..194f91034d 100644
--- a/core/fxge/ge/fx_ge_fontmap.cpp
+++ b/core/fxge/ge/fx_ge_fontmap.cpp
@@ -758,11 +758,11 @@ void CFX_FontMapper::AddInstalledFont(const CFX_ByteString& name, int charset) {
}
if (bLocalized) {
- void* hFont = m_pFontInfo->GetFont(name);
+ void* hFont = m_pFontInfo->GetFont(name.c_str());
if (!hFont) {
int iExact;
- hFont =
- m_pFontInfo->MapFont(0, 0, FXFONT_DEFAULT_CHARSET, 0, name, iExact);
+ hFont = m_pFontInfo->MapFont(0, 0, FXFONT_DEFAULT_CHARSET, 0,
+ name.c_str(), iExact);
if (!hFont)
return;
}
@@ -796,7 +796,7 @@ CFX_ByteString CFX_FontMapper::MatchInstalledFonts(
LoadInstalledFonts();
int i;
for (i = pdfium::CollectionSize<int>(m_InstalledTTFonts) - 1; i >= 0; i--) {
- CFX_ByteString norm1 = TT_NormalizeName(m_InstalledTTFonts[i]);
+ CFX_ByteString norm1 = TT_NormalizeName(m_InstalledTTFonts[i].c_str());
if (norm1 == norm_name) {
break;
}
@@ -972,7 +972,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name,
}
if (!style.IsEmpty()) {
int nLen = style.GetLength();
- const FX_CHAR* pStyle = style;
+ const FX_CHAR* pStyle = style.c_str();
int i = 0;
FX_BOOL bFirstItem = TRUE;
CFX_ByteString buf;
@@ -1045,10 +1045,10 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name,
PitchFamily);
}
family = GetFontFamily(family, nStyle);
- CFX_ByteString match = MatchInstalledFonts(TT_NormalizeName(family));
+ CFX_ByteString match = MatchInstalledFonts(TT_NormalizeName(family.c_str()));
if (match.IsEmpty() && family != SubstName &&
(!bHasComma && (!bHasHypen || (bHasHypen && !bStyleAvail)))) {
- match = MatchInstalledFonts(TT_NormalizeName(SubstName));
+ match = MatchInstalledFonts(TT_NormalizeName(SubstName.c_str()));
}
if (match.IsEmpty() && iBaseFont >= 12) {
if (!bCJK) {
@@ -1104,7 +1104,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name,
}
iExact = !match.IsEmpty();
void* hFont = m_pFontInfo->MapFont(weight, bItalic, Charset, PitchFamily,
- family, iExact);
+ family.c_str(), iExact);
if (iExact) {
pSubstFont->m_SubstFlags |= FXFONT_SUBST_EXACT;
}
@@ -1123,7 +1123,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name,
weight = old_weight;
}
if (!match.IsEmpty()) {
- hFont = m_pFontInfo->GetFont(match);
+ hFont = m_pFontInfo->GetFont(match.c_str());
if (!hFont) {
return UseInternalSubst(pSubstFont, iBaseFont, italic_angle, old_weight,
PitchFamily);
@@ -1165,7 +1165,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name,
return UseInternalSubst(pSubstFont, iBaseFont, italic_angle, old_weight,
PitchFamily);
}
- hFont = m_pFontInfo->GetFont(it->name);
+ hFont = m_pFontInfo->GetFont(it->name.c_str());
}
}
pSubstFont->m_ExtHandle = m_pFontInfo->RetainFont(hFont);
@@ -1381,7 +1381,7 @@ FX_BOOL CFX_FolderFontInfo::EnumFontList(CFX_FontMapper* pMapper) {
return TRUE;
}
void CFX_FolderFontInfo::ScanPath(const CFX_ByteString& path) {
- void* handle = FX_OpenFolder(path);
+ void* handle = FX_OpenFolder(path.c_str());
if (!handle)
return;
@@ -1412,7 +1412,7 @@ void CFX_FolderFontInfo::ScanPath(const CFX_ByteString& path) {
}
void CFX_FolderFontInfo::ScanFile(const CFX_ByteString& path) {
- FXSYS_FILE* pFile = FXSYS_fopen(path, "rb");
+ FXSYS_FILE* pFile = FXSYS_fopen(path.c_str(), "rb");
if (!pFile)
return;
@@ -1616,7 +1616,7 @@ uint32_t CFX_FolderFontInfo::GetFontData(void* hFont,
if (!datasize || size < datasize)
return datasize;
- FXSYS_FILE* pFile = FXSYS_fopen(pFont->m_FilePath, "rb");
+ FXSYS_FILE* pFile = FXSYS_fopen(pFont->m_FilePath.c_str(), "rb");
if (!pFile)
return 0;
diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp
index 60ae57c767..f8057e7d5d 100644
--- a/core/fxge/win32/fx_win32_device.cpp
+++ b/core/fxge/win32/fx_win32_device.cpp
@@ -350,7 +350,7 @@ void* CFX_Win32FontInfo::MapFont(int weight,
}
HFONT hFont =
::CreateFontA(-10, 0, 0, 0, weight, bItalic, 0, 0, charset,
- OUT_TT_ONLY_PRECIS, 0, 0, subst_pitch_family, face);
+ OUT_TT_ONLY_PRECIS, 0, 0, subst_pitch_family, face.c_str());
char facebuf[100];
HFONT hOldFont = (HFONT)::SelectObject(m_hDC, hFont);
::GetTextFaceA(m_hDC, 100, facebuf);
@@ -393,8 +393,9 @@ void* CFX_Win32FontInfo::MapFont(int weight,
}
break;
}
- hFont = ::CreateFontA(-10, 0, 0, 0, weight, bItalic, 0, 0, charset,
- OUT_TT_ONLY_PRECIS, 0, 0, subst_pitch_family, face);
+ hFont =
+ ::CreateFontA(-10, 0, 0, 0, weight, bItalic, 0, 0, charset,
+ OUT_TT_ONLY_PRECIS, 0, 0, subst_pitch_family, face.c_str());
return hFont;
}
void CFX_Win32FontInfo::DeleteFont(void* hFont) {
diff --git a/core/fxge/win32/fx_win32_gdipext.cpp b/core/fxge/win32/fx_win32_gdipext.cpp
index 4e52a8941a..15f0972bba 100644
--- a/core/fxge/win32/fx_win32_gdipext.cpp
+++ b/core/fxge/win32/fx_win32_gdipext.cpp
@@ -686,7 +686,7 @@ void CGdiplusExt::Load() {
strPlusPath += buf;
strPlusPath += "\\";
strPlusPath += "GDIPLUS.DLL";
- m_hModule = LoadLibraryA(strPlusPath);
+ m_hModule = LoadLibraryA(strPlusPath.c_str());
if (!m_hModule) {
return;
}