summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_fontmgr.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-09-21 10:45:18 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-21 19:31:12 +0000
commita44a48043e54eac6126c9a2cfae9e6055ef4a15f (patch)
tree9d9c10223c60257e000aa8b9f3ef5236798891c1 /xfa/fxfa/cxfa_fontmgr.cpp
parent959c2bebde7f46b194f0f83ba5626cb982213638 (diff)
downloadpdfium-a44a48043e54eac6126c9a2cfae9e6055ef4a15f.tar.xz
Move CFGAS_PDFFontMgr to the CXFA_FFDoc
This CL removes the map of CXFA_FFDoc -> CFGAS_PDFFontMgr from the CXFA_FontMgr and moves the storage of the PDFFontMgr into the CXFA_FFDoc itself. Change-Id: Ia725ddd94b1ac2c9504bfd6370040ab6ac01e272 Reviewed-on: https://pdfium-review.googlesource.com/14590 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.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/xfa/fxfa/cxfa_fontmgr.cpp b/xfa/fxfa/cxfa_fontmgr.cpp
index d5ba2ea807..5a11dd5dc0 100644
--- a/xfa/fxfa/cxfa_fontmgr.cpp
+++ b/xfa/fxfa/cxfa_fontmgr.cpp
@@ -36,9 +36,8 @@ CFX_RetainPtr<CFGAS_GEFont> CXFA_FontMgr::GetFont(
return iter->second;
WideString wsEnglishName = FGAS_FontNameToEnglishName(wsFontFamily);
- auto it = m_PDFFontMgrMap.find(hDoc);
- CFGAS_PDFFontMgr* pMgr =
- it != m_PDFFontMgrMap.end() ? it->second.get() : nullptr;
+
+ CFGAS_PDFFontMgr* pMgr = hDoc->GetPDFFontMgr();
CPDF_Font* pPDFFont = nullptr;
CFX_RetainPtr<CFGAS_GEFont> pFont;
if (pMgr) {
@@ -62,6 +61,7 @@ CFX_RetainPtr<CFGAS_GEFont> CXFA_FontMgr::GetFont(
pFont = m_pDefFontMgr->GetDefaultFont(
hDoc->GetApp()->GetFDEFontMgr(), wsFontFamily, dwFontStyles, wCodePage);
}
+
if (pFont) {
if (pPDFFont) {
pMgr->SetFont(pFont, pPDFFont);
@@ -72,16 +72,6 @@ CFX_RetainPtr<CFGAS_GEFont> CXFA_FontMgr::GetFont(
return pFont;
}
-void CXFA_FontMgr::LoadDocFonts(CXFA_FFDoc* hDoc) {
- if (!m_PDFFontMgrMap[hDoc])
- m_PDFFontMgrMap[hDoc] = pdfium::MakeUnique<CFGAS_PDFFontMgr>(
- hDoc->GetPDFDoc(), hDoc->GetApp()->GetFDEFontMgr());
-}
-
-void CXFA_FontMgr::ReleaseDocFonts(CXFA_FFDoc* hDoc) {
- m_PDFFontMgrMap.erase(hDoc);
-}
-
void CXFA_FontMgr::SetDefFontMgr(
std::unique_ptr<CFGAS_DefaultFontManager> pFontMgr) {
m_pDefFontMgr = std::move(pFontMgr);