From db0312e6acd7cc15fef0f64e05bd463cb74c70e4 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 21 Sep 2017 09:46:03 -0400 Subject: Move CXFA_PDFFontMgr to CFGAS_PDFFontMgr XFA bits passed into the PDFFontMgr are just used to get the CPDF_Document and the CFGAS_FontMgr. This CL changes the code to pass those two things into the constructor. Then, the fxfa/cxfa_pdffontmgr.* code has been moved to fgas/cfgas_pdffontmgr.* to show it doesn't depend on any of the XFA classes. Change-Id: I21d791869e2a32ffedfd7c87bb3bbd035232d991 Reviewed-on: https://pdfium-review.googlesource.com/14550 Commit-Queue: dsinclair Reviewed-by: Henrique Nakashima Reviewed-by: Tom Sepez --- xfa/fxfa/cxfa_fontmgr.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xfa/fxfa/cxfa_fontmgr.cpp') diff --git a/xfa/fxfa/cxfa_fontmgr.cpp b/xfa/fxfa/cxfa_fontmgr.cpp index b47ce6b21d..7d2ad70f48 100644 --- a/xfa/fxfa/cxfa_fontmgr.cpp +++ b/xfa/fxfa/cxfa_fontmgr.cpp @@ -1748,7 +1748,7 @@ CFX_RetainPtr CXFA_FontMgr::GetFont( WideString wsEnglishName = XFA_LocalFontNameToEnglishName(wsFontFamily); auto it = m_PDFFontMgrMap.find(hDoc); - CXFA_PDFFontMgr* pMgr = + CFGAS_PDFFontMgr* pMgr = it != m_PDFFontMgrMap.end() ? it->second.get() : nullptr; CPDF_Font* pPDFFont = nullptr; CFX_RetainPtr pFont; @@ -1784,7 +1784,8 @@ CFX_RetainPtr CXFA_FontMgr::GetFont( void CXFA_FontMgr::LoadDocFonts(CXFA_FFDoc* hDoc) { if (!m_PDFFontMgrMap[hDoc]) - m_PDFFontMgrMap[hDoc] = pdfium::MakeUnique(hDoc); + m_PDFFontMgrMap[hDoc] = pdfium::MakeUnique( + hDoc->GetPDFDoc(), hDoc->GetApp()->GetFDEFontMgr()); } void CXFA_FontMgr::ReleaseDocFonts(CXFA_FFDoc* hDoc) { -- cgit v1.2.3