From 1a43b3064dc38a55de4b1d727237806578bb3ef9 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 26 Sep 2017 11:09:35 -0400 Subject: Remove font default params This CL removes some default parameters from the font code. Change-Id: If6f6e09c93474e1e8b7ffaae53eb37dd40c32fab Reviewed-on: https://pdfium-review.googlesource.com/14815 Reviewed-by: Ryan Harrison Commit-Queue: dsinclair --- xfa/fgas/font/cfgas_defaultfontmanager.cpp | 14 ++++++-------- xfa/fgas/font/cfgas_defaultfontmanager.h | 6 ++---- xfa/fgas/font/cfgas_fontmgr.cpp | 10 +++++----- xfa/fgas/font/cfgas_fontmgr.h | 4 ++-- 4 files changed, 15 insertions(+), 19 deletions(-) (limited to 'xfa/fgas') diff --git a/xfa/fgas/font/cfgas_defaultfontmanager.cpp b/xfa/fgas/font/cfgas_defaultfontmanager.cpp index d3864be16a..4b9091f690 100644 --- a/xfa/fgas/font/cfgas_defaultfontmanager.cpp +++ b/xfa/fgas/font/cfgas_defaultfontmanager.cpp @@ -15,11 +15,10 @@ CFGAS_DefaultFontManager::~CFGAS_DefaultFontManager() {} RetainPtr CFGAS_DefaultFontManager::GetFont( CFGAS_FontMgr* pFontMgr, const WideStringView& wsFontFamily, - uint32_t dwFontStyles, - uint16_t wCodePage) { + uint32_t dwFontStyles) { WideString wsFontName(wsFontFamily); RetainPtr pFont = - pFontMgr->LoadFont(wsFontName.c_str(), dwFontStyles, wCodePage); + pFontMgr->LoadFont(wsFontName.c_str(), dwFontStyles, 0xFFFF); if (!pFont) { const FGAS_FontInfo* pCurFont = FGAS_FontInfoByFontName(wsFontName.AsStringView()); @@ -39,7 +38,7 @@ RetainPtr CFGAS_DefaultFontManager::GetFont( iLength--; } WideString wsReplace = WideString(pReplace, pNameText - pReplace); - pFont = pFontMgr->LoadFont(wsReplace.c_str(), dwStyle, wCodePage); + pFont = pFontMgr->LoadFont(wsReplace.c_str(), dwStyle, 0xFFFF); if (pFont) break; @@ -57,13 +56,12 @@ RetainPtr CFGAS_DefaultFontManager::GetFont( RetainPtr CFGAS_DefaultFontManager::GetDefaultFont( CFGAS_FontMgr* pFontMgr, const WideStringView& wsFontFamily, - uint32_t dwFontStyles, - uint16_t wCodePage) { + uint32_t dwFontStyles) { RetainPtr pFont = - pFontMgr->LoadFont(L"Arial Narrow", dwFontStyles, wCodePage); + pFontMgr->LoadFont(L"Arial Narrow", dwFontStyles, 0xFFFF); if (!pFont) { pFont = pFontMgr->LoadFont(static_cast(nullptr), - dwFontStyles, wCodePage); + dwFontStyles, 0xFFFF); } if (pFont) m_CacheFonts.push_back(pFont); diff --git a/xfa/fgas/font/cfgas_defaultfontmanager.h b/xfa/fgas/font/cfgas_defaultfontmanager.h index 4e2e5e10d4..2afe9ebc54 100644 --- a/xfa/fgas/font/cfgas_defaultfontmanager.h +++ b/xfa/fgas/font/cfgas_defaultfontmanager.h @@ -20,12 +20,10 @@ class CFGAS_DefaultFontManager { RetainPtr GetFont(CFGAS_FontMgr* pFontMgr, const WideStringView& wsFontFamily, - uint32_t dwFontStyles, - uint16_t wCodePage = 0xFFFF); + uint32_t dwFontStyles); RetainPtr GetDefaultFont(CFGAS_FontMgr* pFontMgr, const WideStringView& wsFontFamily, - uint32_t dwFontStyles, - uint16_t wCodePage = 0xFFFF); + uint32_t dwFontStyles); private: std::vector> m_CacheFonts; diff --git a/xfa/fgas/font/cfgas_fontmgr.cpp b/xfa/fgas/font/cfgas_fontmgr.cpp index da1763214b..2175a23288 100644 --- a/xfa/fgas/font/cfgas_fontmgr.cpp +++ b/xfa/fgas/font/cfgas_fontmgr.cpp @@ -207,11 +207,11 @@ RetainPtr CFGAS_FontMgr::GetFontByCodePage( return it->second ? LoadFont(it->second, dwFontStyles, wCodePage) : nullptr; } const FX_FONTDESCRIPTOR* pFD = - FindFont(pszFontFamily, dwFontStyles, true, wCodePage); + FindFont(pszFontFamily, dwFontStyles, true, wCodePage, 999, 0); if (!pFD) - pFD = FindFont(nullptr, dwFontStyles, true, wCodePage); + pFD = FindFont(nullptr, dwFontStyles, true, wCodePage, 999, 0); if (!pFD) - pFD = FindFont(nullptr, dwFontStyles, false, wCodePage); + pFD = FindFont(nullptr, dwFontStyles, false, wCodePage, 999, 0); if (!pFD) return nullptr; @@ -276,9 +276,9 @@ RetainPtr CFGAS_FontMgr::LoadFont(const wchar_t* pszFontFamily, return it->second ? LoadFont(it->second, dwFontStyles, wCodePage) : nullptr; const FX_FONTDESCRIPTOR* pFD = - FindFont(pszFontFamily, dwFontStyles, true, wCodePage); + FindFont(pszFontFamily, dwFontStyles, true, wCodePage, 999, 0); if (!pFD) - pFD = FindFont(pszFontFamily, dwFontStyles, false, wCodePage); + pFD = FindFont(pszFontFamily, dwFontStyles, false, wCodePage, 999, 0); if (!pFD) return nullptr; diff --git a/xfa/fgas/font/cfgas_fontmgr.h b/xfa/fgas/font/cfgas_fontmgr.h index 0bcee12e4d..9424cd9657 100644 --- a/xfa/fgas/font/cfgas_fontmgr.h +++ b/xfa/fgas/font/cfgas_fontmgr.h @@ -109,8 +109,8 @@ class CFGAS_FontMgr : public Observable { uint32_t dwFontStyles, uint32_t dwMatchFlags, uint16_t wCodePage, - uint32_t dwUSB = 999, - wchar_t wUnicode = 0); + uint32_t dwUSB, + wchar_t wUnicode); FX_LPEnumAllFonts m_pEnumerator; std::deque m_FontFaces; -- cgit v1.2.3