diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-03-27 19:36:04 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-03-27 19:36:04 +0000 |
commit | e6ce3428fce89f17e2e416adc567a401901f340b (patch) | |
tree | e8341b8deb3856e0a566743671a9ff80a55ce911 /xfa/fxfa/cxfa_ffapp.h | |
parent | 43a25e87afb9b91fd7c0cae2a3429da104d58988 (diff) | |
download | pdfium-e6ce3428fce89f17e2e416adc567a401901f340b.tar.xz |
Simplify some XFA font manager creationchromium/3382
For the cases where we always initialize the font managers, do it in the
constructor instead of as a secondary call.
Change-Id: Ic59b331d1eb357878cd5786b187b5b79bace4498
Reviewed-on: https://pdfium-review.googlesource.com/29291
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_ffapp.h')
-rw-r--r-- | xfa/fxfa/cxfa_ffapp.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xfa/fxfa/cxfa_ffapp.h b/xfa/fxfa/cxfa_ffapp.h index b63f058367..bd4cf363fe 100644 --- a/xfa/fxfa/cxfa_ffapp.h +++ b/xfa/fxfa/cxfa_ffapp.h @@ -15,6 +15,7 @@ #include "core/fxcrt/retain_ptr.h" #include "core/fxcrt/unowned_ptr.h" #include "xfa/fwl/cfwl_app.h" +#include "xfa/fxfa/cxfa_fontmgr.h" #include "xfa/fxfa/fxfa.h" class CFGAS_DefaultFontManager; @@ -22,7 +23,6 @@ class CFGAS_FontMgr; class CFWL_WidgetMgr; class CPDF_Document; class CXFA_FFDocHandler; -class CXFA_FontMgr; class CXFA_FWLAdapterWidgetMgr; class CXFA_FWLTheme; class IFWL_AdapterTimerMgr; @@ -47,7 +47,7 @@ class CXFA_FFApp { IXFA_AppProvider* GetAppProvider() const { return m_pProvider.Get(); } const CFWL_App* GetFWLApp() const { return m_pFWLApp.get(); } IFWL_AdapterTimerMgr* GetTimerMgr() const; - CXFA_FontMgr* GetXFAFontMgr() const; + CXFA_FontMgr* GetXFAFontMgr() { return &m_pFontMgr; } void ClearEventTargets(); @@ -58,14 +58,14 @@ class CXFA_FFApp { // font manager. The GEFont::LoadFont call takes the manager as a param and // stores it internally. When you destroy the GEFont it tries to unregister // from the font manager and if the default font manager was destroyed first - // get get a use-after-free. The m_pFWLTheme can try to cleanup a GEFont + // you get a use-after-free. The m_pFWLTheme can try to cleanup a GEFont // when it frees, so make sure it gets cleaned up first. That requires // m_pFWLApp to be cleaned up as well. // // TODO(dsinclair): The GEFont should have the FontMgr as the pointer instead // of the DEFFontMgr so this goes away. Bug 561. std::unique_ptr<CFGAS_FontMgr> m_pFDEFontMgr; - std::unique_ptr<CXFA_FontMgr> m_pFontMgr; + CXFA_FontMgr m_pFontMgr; std::unique_ptr<CXFA_FWLAdapterWidgetMgr> m_pAdapterWidgetMgr; |