From c29bee029cd5fe3f8a4ceb580235ac2d0e5ce8fd Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 20 Oct 2015 10:22:56 -0700 Subject: Make CFX_FontMgr member variables private. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1405213003 . --- fpdfsdk/src/fsdk_mgr.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp index 4cf05a2d79..fccfbe9aa2 100644 --- a/fpdfsdk/src/fsdk_mgr.cpp +++ b/fpdfsdk/src/fsdk_mgr.cpp @@ -145,20 +145,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; -- cgit v1.2.3