summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fsdk_mgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/fsdk_mgr.cpp')
-rw-r--r--fpdfsdk/src/fsdk_mgr.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp
index 5d765a495d..883ad60a93 100644
--- a/fpdfsdk/src/fsdk_mgr.cpp
+++ b/fpdfsdk/src/fsdk_mgr.cpp
@@ -145,22 +145,20 @@ FX_BOOL CFX_SystemHandler::FindNativeTrueTypeFont(
int32_t nCharset,
CFX_ByteString sFontFaceName) {
CFX_FontMgr* pFontMgr = CFX_GEModule::Get()->GetFontMgr();
- if (!pFontMgr)
- return FALSE;
-
- CFX_FontMapper* pFontMapper = pFontMgr->GetBuiltinMapper();
- if (!pFontMapper)
- return FALSE;
-
- int nSize = pFontMapper->m_InstalledTTFonts.GetSize();
- if (nSize == 0) {
- pFontMapper->LoadInstalledFonts();
- nSize = pFontMapper->m_InstalledTTFonts.GetSize();
- }
+ if (pFontMgr) {
+ CFX_FontMapper* pFontMapper = pFontMgr->m_pBuiltinMapper;
+ if (pFontMapper) {
+ int nSize = pFontMapper->m_InstalledTTFonts.GetSize();
+ if (nSize == 0) {
+ pFontMapper->LoadInstalledFonts();
+ nSize = pFontMapper->m_InstalledTTFonts.GetSize();
+ }
- for (int i = 0; i < nSize; ++i) {
- if (pFontMapper->m_InstalledTTFonts[i].Compare(sFontFaceName))
- return TRUE;
+ for (int i = 0; i < nSize; i++) {
+ if (pFontMapper->m_InstalledTTFonts[i].Compare(sFontFaceName))
+ return TRUE;
+ }
+ }
}
return FALSE;