Remove CFGAS_PDFFontMgr::m_FDE2PDFFont font cache.

This cache is never read.

Change-Id: Iaa4dcf8debf01ab783c2e757a19b18c0317d6fe1
Reviewed-on: https://pdfium-review.googlesource.com/39150
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
diff --git a/xfa/fgas/font/cfgas_pdffontmgr.cpp b/xfa/fgas/font/cfgas_pdffontmgr.cpp
index ad28c9e..80d6196 100644
--- a/xfa/fgas/font/cfgas_pdffontmgr.cpp
+++ b/xfa/fgas/font/cfgas_pdffontmgr.cpp
@@ -35,7 +35,6 @@
 RetainPtr<CFGAS_GEFont> CFGAS_PDFFontMgr::FindFont(const ByteString& strPsName,
                                                    bool bBold,
                                                    bool bItalic,
-                                                   CPDF_Font** pDstPDFFont,
                                                    bool bStrictMatch) {
   CPDF_Dictionary* pFontSetDict =
       m_pDoc->GetRoot()->GetDictFor("AcroForm")->GetDictFor("DR");
@@ -63,10 +62,9 @@
     if (!pPDFFont)
       return nullptr;
 
-    if (!pPDFFont->IsEmbedded()) {
-      *pDstPDFFont = pPDFFont;
+    if (!pPDFFont->IsEmbedded())
       return nullptr;
-    }
+
     return CFGAS_GEFont::LoadFont(pPDFFont->GetFont(), m_pFontMgr.Get());
   }
   return nullptr;
@@ -75,7 +73,6 @@
 RetainPtr<CFGAS_GEFont> CFGAS_PDFFontMgr::GetFont(
     const WideStringView& wsFontFamily,
     uint32_t dwFontStyles,
-    CPDF_Font** pPDFFont,
     bool bStrictMatch) {
   uint32_t dwHashCode = FX_HashCode_GetW(wsFontFamily, false);
   ByteString strKey = ByteString::Format("%u%u", dwHashCode, dwFontStyles);
@@ -88,7 +85,7 @@
   bool bItalic = FontStyleIsItalic(dwFontStyles);
   ByteString strFontName = PsNameToFontName(bsPsName, bBold, bItalic);
   RetainPtr<CFGAS_GEFont> pFont =
-      FindFont(strFontName, bBold, bItalic, pPDFFont, bStrictMatch);
+      FindFont(strFontName, bBold, bItalic, bStrictMatch);
   if (pFont)
     m_FontMap[strKey] = pFont;
 
@@ -182,8 +179,3 @@
   }
   return true;
 }
-
-void CFGAS_PDFFontMgr::SetFont(const RetainPtr<CFGAS_GEFont>& pFont,
-                               CPDF_Font* pPDFFont) {
-  m_FDE2PDFFont[pFont] = pPDFFont;
-}
diff --git a/xfa/fgas/font/cfgas_pdffontmgr.h b/xfa/fgas/font/cfgas_pdffontmgr.h
index 0cc6475..235f883 100644
--- a/xfa/fgas/font/cfgas_pdffontmgr.h
+++ b/xfa/fgas/font/cfgas_pdffontmgr.h
@@ -18,24 +18,20 @@
 class CFGAS_FontMgr;
 class CFGAS_GEFont;
 class CPDF_Document;
-class CPDF_Font;
 
 class CFGAS_PDFFontMgr : public Observable<CFGAS_PDFFontMgr> {
  public:
   explicit CFGAS_PDFFontMgr(CPDF_Document* pDoc, CFGAS_FontMgr* pFontMgr);
   ~CFGAS_PDFFontMgr();
 
-  void SetFont(const RetainPtr<CFGAS_GEFont>& pFont, CPDF_Font* pPDFFont);
   RetainPtr<CFGAS_GEFont> GetFont(const WideStringView& wsFontFamily,
                                   uint32_t dwFontStyles,
-                                  CPDF_Font** pPDFFont,
                                   bool bStrictMatch);
 
  private:
   RetainPtr<CFGAS_GEFont> FindFont(const ByteString& strFamilyName,
                                    bool bBold,
                                    bool bItalic,
-                                   CPDF_Font** pPDFFont,
                                    bool bStrictMatch);
   ByteString PsNameToFontName(const ByteString& strPsName,
                               bool bBold,
@@ -48,7 +44,6 @@
 
   UnownedPtr<CPDF_Document> const m_pDoc;
   UnownedPtr<CFGAS_FontMgr> const m_pFontMgr;
-  std::map<RetainPtr<CFGAS_GEFont>, CPDF_Font*> m_FDE2PDFFont;
   std::map<ByteString, RetainPtr<CFGAS_GEFont>> m_FontMap;
 };
 
diff --git a/xfa/fxfa/cxfa_fontmgr.cpp b/xfa/fxfa/cxfa_fontmgr.cpp
index 8bacf07..7abf720 100644
--- a/xfa/fxfa/cxfa_fontmgr.cpp
+++ b/xfa/fxfa/cxfa_fontmgr.cpp
@@ -38,11 +38,9 @@
   WideString wsEnglishName = FGAS_FontNameToEnglishName(wsFontFamily);
 
   CFGAS_PDFFontMgr* pMgr = hDoc->GetPDFFontMgr();
-  CPDF_Font* pPDFFont = nullptr;
   RetainPtr<CFGAS_GEFont> pFont;
   if (pMgr) {
-    pFont = pMgr->GetFont(wsEnglishName.AsStringView(), dwFontStyles, &pPDFFont,
-                          true);
+    pFont = pMgr->GetFont(wsEnglishName.AsStringView(), dwFontStyles, true);
     if (pFont)
       return pFont;
   }
@@ -51,9 +49,7 @@
                                   dwFontStyles);
 
   if (!pFont && pMgr) {
-    pPDFFont = nullptr;
-    pFont = pMgr->GetFont(wsEnglishName.AsStringView(), dwFontStyles, &pPDFFont,
-                          false);
+    pFont = pMgr->GetFont(wsEnglishName.AsStringView(), dwFontStyles, false);
     if (pFont)
       return pFont;
   }
@@ -73,11 +69,8 @@
                                      hDoc->GetApp()->GetFDEFontMgr());
   }
 
-  if (pFont) {
-    if (pPDFFont)
-      pMgr->SetFont(pFont, pPDFFont);
-
+  if (pFont)
     m_FontMap[bsKey] = pFont;
-  }
+
   return pFont;
 }