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>
diff --git a/xfa/fgas/font/cfgas_defaultfontmanager.cpp b/xfa/fgas/font/cfgas_defaultfontmanager.cpp
index d3864be..4b9091f 100644
--- a/xfa/fgas/font/cfgas_defaultfontmanager.cpp
+++ b/xfa/fgas/font/cfgas_defaultfontmanager.cpp
@@ -15,11 +15,10 @@
 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 @@
           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::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 4e2e5e1..2afe9eb 100644
--- a/xfa/fgas/font/cfgas_defaultfontmanager.h
+++ b/xfa/fgas/font/cfgas_defaultfontmanager.h
@@ -20,12 +20,10 @@
 
   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 da17632..2175a23 100644
--- a/xfa/fgas/font/cfgas_fontmgr.cpp
+++ b/xfa/fgas/font/cfgas_fontmgr.cpp
@@ -207,11 +207,11 @@
     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 @@
     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 0bcee12..9424cd9 100644
--- a/xfa/fgas/font/cfgas_fontmgr.h
+++ b/xfa/fgas/font/cfgas_fontmgr.h
@@ -109,8 +109,8 @@
                                     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 ddf8ffa..d144bd2 100644
--- a/xfa/fxfa/cxfa_fontmgr.cpp
+++ b/xfa/fxfa/cxfa_fontmgr.cpp
@@ -26,11 +26,10 @@
 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 @@
   }
   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 @@
       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 55ee6bb..a940faf 100644
--- a/xfa/fxfa/cxfa_fontmgr.h
+++ b/xfa/fxfa/cxfa_fontmgr.h
@@ -28,8 +28,7 @@
 
   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: