| Index: fpdfsdk/src/fsdk_mgr.cpp
|
| diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp
|
| index 63ed642367f9062a4012880c872d424d8fb40b8b..b7de36c7d3f405cccc3bc119253667e9546fb03d 100644
|
| --- a/fpdfsdk/src/fsdk_mgr.cpp
|
| +++ b/fpdfsdk/src/fsdk_mgr.cpp
|
| @@ -146,20 +146,22 @@ FX_BOOL CFX_SystemHandler::FindNativeTrueTypeFont(
|
| int32_t nCharset,
|
| CFX_ByteString sFontFaceName) {
|
| CFX_FontMgr* pFontMgr = CFX_GEModule::Get()->GetFontMgr();
|
| - 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();
|
| - }
|
| + if (!pFontMgr)
|
| + return FALSE;
|
|
|
| - for (int i = 0; i < nSize; i++) {
|
| - if (pFontMapper->m_InstalledTTFonts[i].Compare(sFontFaceName))
|
| - return TRUE;
|
| - }
|
| - }
|
| + 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();
|
| + }
|
| +
|
| + for (int i = 0; i < nSize; ++i) {
|
| + if (pFontMapper->m_InstalledTTFonts[i].Compare(sFontFaceName))
|
| + return TRUE;
|
| }
|
|
|
| return FALSE;
|
|
|