Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(696)

Unified Diff: fpdfsdk/src/fsdk_mgr.cpp

Issue 1412733011: Make CFX_FontMgr member variables private. (try 2) (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: delete in the right order, rebase Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fxge/ge/fx_ge_text.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fsdk_mgr.cpp
diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp
index 4cf05a2d79d35ee4a15f047a4531c8b7e53c40a7..fccfbe9aa22f7955cab848720427c2e4b3e243d0 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;
« no previous file with comments | « core/src/fxge/ge/fx_ge_text.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698