summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-09-26 11:09:35 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-26 15:21:44 +0000
commit1a43b3064dc38a55de4b1d727237806578bb3ef9 (patch)
tree66c790a154b68fdd6ea63c0bb4cabc0fac0badf4
parenta7caeb52912150e59aadf49ed21a45a4a1260a4a (diff)
downloadpdfium-1a43b3064dc38a55de4b1d727237806578bb3ef9.tar.xz
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 <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
-rw-r--r--xfa/fgas/font/cfgas_defaultfontmanager.cpp14
-rw-r--r--xfa/fgas/font/cfgas_defaultfontmanager.h6
-rw-r--r--xfa/fgas/font/cfgas_fontmgr.cpp10
-rw-r--r--xfa/fgas/font/cfgas_fontmgr.h4
-rw-r--r--xfa/fxfa/cxfa_fontmgr.cpp11
-rw-r--r--xfa/fxfa/cxfa_fontmgr.h3
6 files changed, 21 insertions, 27 deletions
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_GEFont> CFGAS_DefaultFontManager::GetFont(
CFGAS_FontMgr* pFontMgr,
const WideStringView& wsFontFamily,
- uint32_t dwFontStyles,
- uint16_t wCodePage) {
+ uint32_t dwFontStyles) {
WideString wsFontName(wsFontFamily);
RetainPtr<CFGAS_GEFont> 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_GEFont> 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_GEFont> CFGAS_DefaultFontManager::GetFont(
RetainPtr<CFGAS_GEFont> CFGAS_DefaultFontManager::GetDefaultFont(
CFGAS_FontMgr* pFontMgr,
const WideStringView& wsFontFamily,
- uint32_t dwFontStyles,
- uint16_t wCodePage) {
+ uint32_t dwFontStyles) {
RetainPtr<CFGAS_GEFont> pFont =
- pFontMgr->LoadFont(L"Arial Narrow", dwFontStyles, wCodePage);
+ pFontMgr->LoadFont(L"Arial Narrow", dwFontStyles, 0xFFFF);
if (!pFont) {
pFont = pFontMgr->LoadFont(static_cast<const wchar_t*>(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<CFGAS_GEFont> GetFont(CFGAS_FontMgr* pFontMgr,
const WideStringView& wsFontFamily,
- uint32_t dwFontStyles,
- uint16_t wCodePage = 0xFFFF);
+ uint32_t dwFontStyles);
RetainPtr<CFGAS_GEFont> GetDefaultFont(CFGAS_FontMgr* pFontMgr,
const WideStringView& wsFontFamily,
- uint32_t dwFontStyles,
- uint16_t wCodePage = 0xFFFF);
+ uint32_t dwFontStyles);
private:
std::vector<RetainPtr<CFGAS_GEFont>> 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_GEFont> 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_GEFont> 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<CFGAS_FontMgr> {
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<FX_FONTDESCRIPTOR> m_FontFaces;
diff --git a/xfa/fxfa/cxfa_fontmgr.cpp b/xfa/fxfa/cxfa_fontmgr.cpp
index ddf8ffada4..d144bd2cb5 100644
--- a/xfa/fxfa/cxfa_fontmgr.cpp
+++ b/xfa/fxfa/cxfa_fontmgr.cpp
@@ -26,11 +26,10 @@ CXFA_FontMgr::~CXFA_FontMgr() {}
RetainPtr<CFGAS_GEFont> CXFA_FontMgr::GetFont(
CXFA_FFDoc* hDoc,
const WideStringView& wsFontFamily,
- uint32_t dwFontStyles,
- uint16_t wCodePage) {
+ uint32_t dwFontStyles) {
uint32_t dwHash = FX_HashCode_GetW(wsFontFamily, false);
ByteString bsKey;
- bsKey.Format("%u%u%u", dwHash, dwFontStyles, wCodePage);
+ bsKey.Format("%u%u%u", dwHash, dwFontStyles, 0xFFFF);
auto iter = m_FontMap.find(bsKey);
if (iter != m_FontMap.end())
return iter->second;
@@ -48,7 +47,7 @@ RetainPtr<CFGAS_GEFont> CXFA_FontMgr::GetFont(
}
if (!pFont && m_pDefFontMgr)
pFont = m_pDefFontMgr->GetFont(hDoc->GetApp()->GetFDEFontMgr(),
- wsFontFamily, dwFontStyles, wCodePage);
+ wsFontFamily, dwFontStyles);
if (!pFont && pMgr) {
pPDFFont = nullptr;
@@ -58,8 +57,8 @@ RetainPtr<CFGAS_GEFont> CXFA_FontMgr::GetFont(
return pFont;
}
if (!pFont && m_pDefFontMgr) {
- pFont = m_pDefFontMgr->GetDefaultFont(
- hDoc->GetApp()->GetFDEFontMgr(), wsFontFamily, dwFontStyles, wCodePage);
+ pFont = m_pDefFontMgr->GetDefaultFont(hDoc->GetApp()->GetFDEFontMgr(),
+ wsFontFamily, dwFontStyles);
}
if (pFont) {
diff --git a/xfa/fxfa/cxfa_fontmgr.h b/xfa/fxfa/cxfa_fontmgr.h
index 55ee6bbc4d..a940fafc46 100644
--- a/xfa/fxfa/cxfa_fontmgr.h
+++ b/xfa/fxfa/cxfa_fontmgr.h
@@ -28,8 +28,7 @@ class CXFA_FontMgr {
RetainPtr<CFGAS_GEFont> GetFont(CXFA_FFDoc* hDoc,
const WideStringView& wsFontFamily,
- uint32_t dwFontStyles,
- uint16_t wCodePage = 0xFFFF);
+ uint32_t dwFontStyles);
void SetDefFontMgr(std::unique_ptr<CFGAS_DefaultFontManager> pFontMgr);
private: