Cleanup some PWL_FontMap methods

This CL makes some methods private which are only used internally, removes
unused methods and removes an unused class.

Review-Url: https://codereview.chromium.org/2278583002
diff --git a/fpdfsdk/pdfwindow/PWL_FontMap.cpp b/fpdfsdk/pdfwindow/PWL_FontMap.cpp
index 131334a..d0fa5e4 100644
--- a/fpdfsdk/pdfwindow/PWL_FontMap.cpp
+++ b/fpdfsdk/pdfwindow/PWL_FontMap.cpp
@@ -44,10 +44,6 @@
   Empty();
 }
 
-void CPWL_FontMap::SetSystemHandler(CFX_SystemHandler* pSystemHandler) {
-  m_pSystemHandler = pSystemHandler;
-}
-
 CPDF_Document* CPWL_FontMap::GetDocument() {
   if (!m_pPDFDoc) {
     if (CPDF_ModuleMgr::Get()) {
@@ -277,12 +273,10 @@
     nCharset = GetNativeCharset();
 
   CFX_ByteString sFontName = GetDefaultFontByCharset(nCharset);
-  if (m_pSystemHandler) {
-    if (m_pSystemHandler->FindNativeTrueTypeFont(sFontName))
-      return sFontName;
+  if (m_pSystemHandler->FindNativeTrueTypeFont(sFontName))
+    return sFontName;
 
-    sFontName.clear();
-  }
+  sFontName.clear();
   return sFontName;
 }
 
@@ -323,11 +317,8 @@
   if (nCharset == DEFAULT_CHARSET)
     nCharset = GetNativeCharset();
 
-  if (m_pSystemHandler)
-    return m_pSystemHandler->AddNativeTrueTypeFontToPDF(pDoc, sFontName,
-                                                        nCharset);
-
-  return nullptr;
+  return m_pSystemHandler->AddNativeTrueTypeFontToPDF(pDoc, sFontName,
+                                                      nCharset);
 }
 
 CFX_ByteString CPWL_FontMap::EncodeFontAlias(const CFX_ByteString& sFontName,
@@ -485,13 +476,3 @@
 
   return ANSI_CHARSET;
 }
-
-CPWL_DocFontMap::CPWL_DocFontMap(CFX_SystemHandler* pSystemHandler,
-                                 CPDF_Document* pAttachedDoc)
-    : CPWL_FontMap(pSystemHandler), m_pAttachedDoc(pAttachedDoc) {}
-
-CPWL_DocFontMap::~CPWL_DocFontMap() {}
-
-CPDF_Document* CPWL_DocFontMap::GetDocument() {
-  return m_pAttachedDoc;
-}
diff --git a/fpdfsdk/pdfwindow/PWL_FontMap.h b/fpdfsdk/pdfwindow/PWL_FontMap.h
index 7f347f5..3541be5 100644
--- a/fpdfsdk/pdfwindow/PWL_FontMap.h
+++ b/fpdfsdk/pdfwindow/PWL_FontMap.h
@@ -65,23 +65,12 @@
   int32_t CharCodeFromUnicode(int32_t nFontIndex, uint16_t word) override;
   int32_t CharSetFromUnicode(uint16_t word, int32_t nOldCharset) override;
 
-  void SetSystemHandler(CFX_SystemHandler* pSystemHandler);
   int32_t GetFontMapCount() const;
   const CPWL_FontMap_Data* GetFontMapData(int32_t nIndex) const;
   static int32_t GetNativeCharset();
   CFX_ByteString GetNativeFontName(int32_t nCharset);
 
   static CFX_ByteString GetDefaultFontByCharset(int32_t nCharset);
-
-  CPDF_Font* AddFontToDocument(CPDF_Document* pDoc,
-                               CFX_ByteString& sFontName,
-                               uint8_t nCharset);
-  static FX_BOOL IsStandardFont(const CFX_ByteString& sFontName);
-  CPDF_Font* AddStandardFont(CPDF_Document* pDoc, CFX_ByteString& sFontName);
-  CPDF_Font* AddSystemFont(CPDF_Document* pDoc,
-                           CFX_ByteString& sFontName,
-                           uint8_t nCharset);
-
   static const FPDF_CharsetFontMap defaultTTFMap[];
 
  protected:
@@ -115,22 +104,17 @@
                    int32_t nCharset = DEFAULT_CHARSET);
 
   CFX_ByteString GetNativeFont(int32_t nCharset);
+  CPDF_Font* AddFontToDocument(CPDF_Document* pDoc,
+                               CFX_ByteString& sFontName,
+                               uint8_t nCharset);
+  FX_BOOL IsStandardFont(const CFX_ByteString& sFontName);
+  CPDF_Font* AddStandardFont(CPDF_Document* pDoc, CFX_ByteString& sFontName);
+  CPDF_Font* AddSystemFont(CPDF_Document* pDoc,
+                           CFX_ByteString& sFontName,
+                           uint8_t nCharset);
 
   std::unique_ptr<CPDF_Document> m_pPDFDoc;
-  CFX_SystemHandler* m_pSystemHandler;
-};
-
-class CPWL_DocFontMap : public CPWL_FontMap {
- public:
-  CPWL_DocFontMap(CFX_SystemHandler* pSystemHandler,
-                  CPDF_Document* pAttachedDoc);
-  ~CPWL_DocFontMap() override;
-
- private:
-  // CPWL_FontMap:
-  CPDF_Document* GetDocument() override;
-
-  CPDF_Document* m_pAttachedDoc;
+  CFX_SystemHandler* const m_pSystemHandler;
 };
 
 #endif  // FPDFSDK_PDFWINDOW_PWL_FONTMAP_H_