diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-10-04 22:14:52 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-04 22:14:52 +0000 |
commit | b8768b7ca3379d0cd25fddf87799458e39ac5477 (patch) | |
tree | 790c1a6601931ea3c01e5d02f30ac755f7658b21 | |
parent | 047347605c8137d3db8492ce58cc9dc601eb00cf (diff) | |
download | pdfium-b8768b7ca3379d0cd25fddf87799458e39ac5477.tar.xz |
Make some CPWL_FontMap methods pure virtual.
We never instantiate this class by itself, and these don't
get called.
Change-Id: Ibff1e57c93c346d038c5f9f508b601ef919a6895
Reviewed-on: https://pdfium-review.googlesource.com/c/43475
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
-rw-r--r-- | fpdfsdk/pwl/cpwl_font_map.cpp | 17 | ||||
-rw-r--r-- | fpdfsdk/pwl/cpwl_font_map.h | 7 |
2 files changed, 3 insertions, 21 deletions
diff --git a/fpdfsdk/pwl/cpwl_font_map.cpp b/fpdfsdk/pwl/cpwl_font_map.cpp index 47365f8f42..532d210fa5 100644 --- a/fpdfsdk/pwl/cpwl_font_map.cpp +++ b/fpdfsdk/pwl/cpwl_font_map.cpp @@ -47,16 +47,6 @@ CPWL_FontMap::~CPWL_FontMap() { Empty(); } -CPDF_Document* CPWL_FontMap::GetDocument() { - if (!m_pPDFDoc) { - if (CPDF_ModuleMgr::Get()) { - m_pPDFDoc = pdfium::MakeUnique<CPDF_Document>(); - m_pPDFDoc->CreateNewDoc(); - } - } - return m_pPDFDoc.get(); -} - CPDF_Font* CPWL_FontMap::GetPDFFont(int32_t nFontIndex) { if (pdfium::IndexInBounds(m_Data, nFontIndex) && m_Data[nFontIndex]) return m_Data[nFontIndex]->pFont; @@ -187,11 +177,6 @@ int32_t CPWL_FontMap::GetFontIndex(const ByteString& sFontName, return AddFontData(pFont, sAlias, nCharset); } -CPDF_Font* CPWL_FontMap::FindFontSameCharset(ByteString* sFontAlias, - int32_t nCharset) { - return nullptr; -} - int32_t CPWL_FontMap::AddFontData(CPDF_Font* pFont, const ByteString& sFontAlias, int32_t nCharset) { @@ -203,8 +188,6 @@ int32_t CPWL_FontMap::AddFontData(CPDF_Font* pFont, return pdfium::CollectionSize<int32_t>(m_Data) - 1; } -void CPWL_FontMap::AddedFont(CPDF_Font* pFont, const ByteString& sFontAlias) {} - ByteString CPWL_FontMap::GetNativeFont(int32_t nCharset) { if (nCharset == FX_CHARSET_Default) nCharset = GetNativeCharset(); diff --git a/fpdfsdk/pwl/cpwl_font_map.h b/fpdfsdk/pwl/cpwl_font_map.h index 159bd7ff56..c9c7fff3fc 100644 --- a/fpdfsdk/pwl/cpwl_font_map.h +++ b/fpdfsdk/pwl/cpwl_font_map.h @@ -48,10 +48,10 @@ class CPWL_FontMap : public IPVT_FontMap { protected: virtual void Initialize(); - virtual CPDF_Document* GetDocument(); + virtual CPDF_Document* GetDocument() = 0; virtual CPDF_Font* FindFontSameCharset(ByteString* sFontAlias, - int32_t nCharset); - virtual void AddedFont(CPDF_Font* pFont, const ByteString& sFontAlias); + int32_t nCharset) = 0; + virtual void AddedFont(CPDF_Font* pFont, const ByteString& sFontAlias) = 0; bool KnowWord(int32_t nFontIndex, uint16_t word); @@ -81,7 +81,6 @@ class CPWL_FontMap : public IPVT_FontMap { ByteString& sFontName, uint8_t nCharset); - std::unique_ptr<CPDF_Document> m_pPDFDoc; UnownedPtr<CFX_SystemHandler> const m_pSystemHandler; }; |