summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fsdk_mgr.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-10-21 17:07:24 -0700
committerLei Zhang <thestig@chromium.org>2015-10-21 17:07:24 -0700
commit122ee21e38a15554c8c61edd21fda8c110be6072 (patch)
tree208031600c134d48a8af2488fc337dab2e110bde /fpdfsdk/src/fsdk_mgr.cpp
parentafaa98eeb161d60e76506a16d8b986203a7ec0b3 (diff)
downloadpdfium-122ee21e38a15554c8c61edd21fda8c110be6072.tar.xz
Merge to XFA: Make CFX_FontMgr member variables private. (try 2)
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1412733011 . (cherry picked from commit 5a5b6fb3759daf1201ffc9702f626f4b243922d0) Review URL: https://codereview.chromium.org/1414463006 .
Diffstat (limited to 'fpdfsdk/src/fsdk_mgr.cpp')
-rw-r--r--fpdfsdk/src/fsdk_mgr.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp
index 63ed642367..b7de36c7d3 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;