summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_fontmgr.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-03-27 19:36:04 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-27 19:36:04 +0000
commite6ce3428fce89f17e2e416adc567a401901f340b (patch)
treee8341b8deb3856e0a566743671a9ff80a55ce911 /xfa/fxfa/cxfa_fontmgr.cpp
parent43a25e87afb9b91fd7c0cae2a3429da104d58988 (diff)
downloadpdfium-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_fontmgr.cpp')
-rw-r--r--xfa/fxfa/cxfa_fontmgr.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/xfa/fxfa/cxfa_fontmgr.cpp b/xfa/fxfa/cxfa_fontmgr.cpp
index 0956806698..7770825b26 100644
--- a/xfa/fxfa/cxfa_fontmgr.cpp
+++ b/xfa/fxfa/cxfa_fontmgr.cpp
@@ -19,9 +19,9 @@
#include "xfa/fxfa/cxfa_ffapp.h"
#include "xfa/fxfa/cxfa_ffdoc.h"
-CXFA_FontMgr::CXFA_FontMgr() {}
+CXFA_FontMgr::CXFA_FontMgr() = default;
-CXFA_FontMgr::~CXFA_FontMgr() {}
+CXFA_FontMgr::~CXFA_FontMgr() = default;
RetainPtr<CFGAS_GEFont> CXFA_FontMgr::GetFont(
CXFA_FFDoc* hDoc,
@@ -44,9 +44,9 @@ RetainPtr<CFGAS_GEFont> CXFA_FontMgr::GetFont(
if (pFont)
return pFont;
}
- if (!pFont && m_pDefFontMgr)
- pFont = m_pDefFontMgr->GetFont(hDoc->GetApp()->GetFDEFontMgr(),
- wsFontFamily, dwFontStyles);
+ if (!pFont)
+ pFont = m_pDefFontMgr.GetFont(hDoc->GetApp()->GetFDEFontMgr(), wsFontFamily,
+ dwFontStyles);
if (!pFont && pMgr) {
pPDFFont = nullptr;
@@ -55,9 +55,9 @@ RetainPtr<CFGAS_GEFont> CXFA_FontMgr::GetFont(
if (pFont)
return pFont;
}
- if (!pFont && m_pDefFontMgr) {
- pFont = m_pDefFontMgr->GetDefaultFont(hDoc->GetApp()->GetFDEFontMgr(),
- wsFontFamily, dwFontStyles);
+ if (!pFont) {
+ pFont = m_pDefFontMgr.GetDefaultFont(hDoc->GetApp()->GetFDEFontMgr(),
+ wsFontFamily, dwFontStyles);
}
if (pFont) {
@@ -69,8 +69,3 @@ RetainPtr<CFGAS_GEFont> CXFA_FontMgr::GetFont(
}
return pFont;
}
-
-void CXFA_FontMgr::SetDefFontMgr(
- std::unique_ptr<CFGAS_DefaultFontManager> pFontMgr) {
- m_pDefFontMgr = std::move(pFontMgr);
-}