Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: fpdfsdk/pdfwindow/PWL_FontMap.cpp

Issue 2278583002: Cleanup some PWL_FontMap methods (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Review feedback Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/pdfwindow/PWL_FontMap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/pdfwindow/PWL_FontMap.cpp
diff --git a/fpdfsdk/pdfwindow/PWL_FontMap.cpp b/fpdfsdk/pdfwindow/PWL_FontMap.cpp
index 96acb78ec2aa0538730af46e8dfd5d3701152b7e..992d0c001997f2ce31c11eff5c06f4777820e16d 100644
--- a/fpdfsdk/pdfwindow/PWL_FontMap.cpp
+++ b/fpdfsdk/pdfwindow/PWL_FontMap.cpp
@@ -43,10 +43,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()) {
@@ -276,12 +272,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;
}
@@ -322,11 +316,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,
@@ -484,13 +475,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;
-}
« no previous file with comments | « fpdfsdk/pdfwindow/PWL_FontMap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698