summaryrefslogtreecommitdiff
path: root/core/fxge/ge/fx_ge_linux.cpp
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-05-27 15:14:20 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-27 15:14:20 -0700
commit24508dff1636d80be01497e30fccd21533fc0bde (patch)
tree4ae25af19a52e3221d95a505bda42817e11ac3f0 /core/fxge/ge/fx_ge_linux.cpp
parentbbff41927ecce2ff93668aa615307f548ca896eb (diff)
downloadpdfium-24508dff1636d80be01497e30fccd21533fc0bde.tar.xz
Clean up some Android/Windows code.
Review-Url: https://codereview.chromium.org/2004313007
Diffstat (limited to 'core/fxge/ge/fx_ge_linux.cpp')
-rw-r--r--core/fxge/ge/fx_ge_linux.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/core/fxge/ge/fx_ge_linux.cpp b/core/fxge/ge/fx_ge_linux.cpp
index 0d5aff75fa..46d7146026 100644
--- a/core/fxge/ge/fx_ge_linux.cpp
+++ b/core/fxge/ge/fx_ge_linux.cpp
@@ -123,7 +123,9 @@ void* CFX_LinuxFontInfo::MapFont(int weight,
}
return FindFont(weight, bItalic, charset, pitch_family, cstr_face, !bCJK);
}
-IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault(const char** pUserPaths) {
+
+std::unique_ptr<IFX_SystemFontInfo> IFX_SystemFontInfo::CreateDefault(
+ const char** pUserPaths) {
CFX_LinuxFontInfo* pInfo = new CFX_LinuxFontInfo;
if (!pInfo->ParseFontCfg(pUserPaths)) {
pInfo->AddPath("/usr/share/fonts");
@@ -131,17 +133,18 @@ IFX_SystemFontInfo* IFX_SystemFontInfo::CreateDefault(const char** pUserPaths) {
pInfo->AddPath("/usr/share/X11/fonts/TTF");
pInfo->AddPath("/usr/local/share/fonts");
}
- return pInfo;
+ return std::unique_ptr<IFX_SystemFontInfo>(pInfo);
}
+
FX_BOOL CFX_LinuxFontInfo::ParseFontCfg(const char** pUserPaths) {
- if (!pUserPaths) {
+ if (!pUserPaths)
return FALSE;
- }
- for (const char** pPath = pUserPaths; *pPath; ++pPath) {
+
+ for (const char** pPath = pUserPaths; *pPath; ++pPath)
AddPath(*pPath);
- }
return TRUE;
}
+
void CFX_GEModule::InitPlatform() {
m_pFontMgr->SetSystemFontInfo(
IFX_SystemFontInfo::CreateDefault(m_pUserFontPaths));