diff options
author | dsinclair <dsinclair@chromium.org> | 2016-08-24 11:39:24 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-24 11:39:24 -0700 |
commit | 0e3e890ba53ee7900ba44ebe50fecba21d086bfc (patch) | |
tree | b2c389276d0e2be457778ec5f3ebb250a127b740 /fpdfsdk/pdfwindow/PWL_FontMap.cpp | |
parent | b107193e9780b4a50e85d54c1ffbd2303263e193 (diff) | |
download | pdfium-0e3e890ba53ee7900ba44ebe50fecba21d086bfc.tar.xz |
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
Diffstat (limited to 'fpdfsdk/pdfwindow/PWL_FontMap.cpp')
-rw-r--r-- | fpdfsdk/pdfwindow/PWL_FontMap.cpp | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_FontMap.cpp b/fpdfsdk/pdfwindow/PWL_FontMap.cpp index 131334ac22..d0fa5e4c74 100644 --- a/fpdfsdk/pdfwindow/PWL_FontMap.cpp +++ b/fpdfsdk/pdfwindow/PWL_FontMap.cpp @@ -44,10 +44,6 @@ CPWL_FontMap::~CPWL_FontMap() { 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 @@ CFX_ByteString CPWL_FontMap::GetNativeFont(int32_t nCharset) { 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 @@ CPDF_Font* CPWL_FontMap::AddSystemFont(CPDF_Document* pDoc, 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 @@ int32_t CPWL_FontMap::CharSetFromUnicode(uint16_t word, int32_t nOldCharset) { 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; -} |