From 81f02f4c8347890ce66d6ec48781589d10098689 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 26 Sep 2017 12:02:16 -0400 Subject: Move font source into CFGAS_FontMgr This CL moves the font source into the font manager so it doesn't need to be stored by each caller (and removes the platform dependant code). The |EnumFonts| method is exposed on the CFGAS_FontMgr so the caller can clear the manager if the enumeration fails. Change-Id: Iecce3d2e09ff01152b7bb79a34fe2b728320da9c Reviewed-on: https://pdfium-review.googlesource.com/14816 Reviewed-by: Henrique Nakashima Commit-Queue: dsinclair --- xfa/fxfa/cxfa_ffapp.cpp | 9 +++------ xfa/fxfa/cxfa_ffapp.h | 3 --- 2 files changed, 3 insertions(+), 9 deletions(-) (limited to 'xfa/fxfa') diff --git a/xfa/fxfa/cxfa_ffapp.cpp b/xfa/fxfa/cxfa_ffapp.cpp index 8ec23e19c4..e3ca42c129 100644 --- a/xfa/fxfa/cxfa_ffapp.cpp +++ b/xfa/fxfa/cxfa_ffapp.cpp @@ -62,12 +62,9 @@ CXFA_FontMgr* CXFA_FFApp::GetXFAFontMgr() const { CFGAS_FontMgr* CXFA_FFApp::GetFDEFontMgr() { if (!m_pFDEFontMgr) { -#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ - m_pFDEFontMgr = CFGAS_FontMgr::Create(FX_GetDefFontEnumerator()); -#else - m_pFontSource = pdfium::MakeUnique(); - m_pFDEFontMgr = CFGAS_FontMgr::Create(m_pFontSource.get()); -#endif + m_pFDEFontMgr = pdfium::MakeUnique(); + if (!m_pFDEFontMgr->EnumFonts()) + m_pFDEFontMgr = nullptr; } return m_pFDEFontMgr.get(); } diff --git a/xfa/fxfa/cxfa_ffapp.h b/xfa/fxfa/cxfa_ffapp.h index 351ba032a0..2ce718a36a 100644 --- a/xfa/fxfa/cxfa_ffapp.h +++ b/xfa/fxfa/cxfa_ffapp.h @@ -67,9 +67,6 @@ class CXFA_FFApp { std::unique_ptr m_pFDEFontMgr; std::unique_ptr m_pFontMgr; -#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ - std::unique_ptr m_pFontSource; -#endif std::unique_ptr m_pAdapterWidgetMgr; // |m_pFWLApp| has to be released first, then |m_pFWLTheme| since the former -- cgit v1.2.3