diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2016-12-29 21:52:36 +0200 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2016-12-30 01:36:52 +0200 |
commit | aef0a650d35620692b2451c684d38a2b3fecf5a0 (patch) | |
tree | 7b1abee82050d2ac8b5e55d23368de9f08658c72 /vcl | |
parent | bd26052f4b07e2fb7aa2a6996cfdb7777134c043 (diff) |
Simplify this a bit
The return value from addFontconfigDir() was effectively unused after
the recent changes in this code.
Change-Id: I99796442fe3bcaf767f3b804afd417b9d043c2a9
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/unx/fontmanager.hxx | 6 | ||||
-rw-r--r-- | vcl/unx/generic/fontmanager/fontconfig.cxx | 8 | ||||
-rw-r--r-- | vcl/unx/generic/fontmanager/fontmanager.cxx | 11 |
3 files changed, 7 insertions, 18 deletions
diff --git a/vcl/inc/unx/fontmanager.hxx b/vcl/inc/unx/fontmanager.hxx index d922301031d1..bf5e7b0d133f 100644 --- a/vcl/inc/unx/fontmanager.hxx +++ b/vcl/inc/unx/fontmanager.hxx @@ -205,12 +205,8 @@ class VCL_PLUGIN_PUBLIC PrintFontManager since fontconfig is asked for font substitutes before OOo will check for font availability and fontconfig will happily substitute fonts it doesn't know (e.g. "Arial Narrow" -> "DejaVu Sans Book"!) it becomes necessary to tell the library about all the hidden font treasures - - @returns - true if libfontconfig accepted the directory - false else (e.g. no libfontconfig found) */ - static bool addFontconfigDir(const OString& rDirectory); + static void addFontconfigDir(const OString& rDirectory); std::set<OString> m_aPreviousLangSupportRequests; #if ENABLE_DBUS diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index 3c594f545f31..4d9fae12e68d 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -657,13 +657,13 @@ void PrintFontManager::deinitFontconfig() FontCfgWrapper::release(); } -bool PrintFontManager::addFontconfigDir( const OString& rDirName ) +void PrintFontManager::addFontconfigDir( const OString& rDirName ) { // workaround for a stability problems in older FC versions // when handling application specific fonts const int nVersion = FcGetVersion(); if( nVersion <= 20400 ) - return false; + return; const char* pDirName = rDirName.getStr(); bool bDirOk = (FcConfigAppFontAddDir(FcConfigGetCurrent(), reinterpret_cast<FcChar8 const *>(pDirName) ) == FcTrue); @@ -672,7 +672,7 @@ bool PrintFontManager::addFontconfigDir( const OString& rDirName ) #endif if( !bDirOk ) - return false; + return; // load dir-specific fc-config file too if available const OString aConfFileName = rDirName + "/fc_local.conf"; @@ -686,7 +686,7 @@ bool PrintFontManager::addFontconfigDir( const OString& rDirName ) fprintf( stderr, "FcConfigParseAndLoad( \"%s\") => %d\n", aConfFileName.getStr(), bCfgOk ); } - return true; + return; } static void addtopattern(FcPattern *pPattern, diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx index 8e7ab173e810..bff7e4e40628 100644 --- a/vcl/unx/generic/fontmanager/fontmanager.cxx +++ b/vcl/unx/generic/fontmanager/fontmanager.cxx @@ -759,15 +759,8 @@ void PrintFontManager::initialize() { OString aToken = aPath.getToken( 0, ';', nIndex ); normPath( aToken ); - if ( aToken.isEmpty() ) - { - continue; - } - // if registering an app-specific fontdir with fontconfig fails - // and fontconfig-based substitutions are enabled - // then trying to use these app-specific fonts doesn't make sense - if( !addFontconfigDir( aToken ) ) - continue; + if (!aToken.isEmpty()) + addFontconfigDir(aToken); } while( nIndex >= 0 ); } |