diff options
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/generic/fontmanager/fontconfig.cxx | 3 | ||||
-rw-r--r-- | vcl/unx/generic/fontmanager/fontmanager.cxx | 16 |
2 files changed, 9 insertions, 10 deletions
diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index 459678819575..34b9ba27f642 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -548,7 +548,6 @@ void PrintFontManager::countFontconfigFonts( std::unordered_map<OString, int, OS // see if this font is already cached // update attributes - std::list<std::unique_ptr<PrintFont>> aFonts; OString aDir, aBase, aOrgPath( reinterpret_cast<char*>(file) ); splitPath( aOrgPath, aDir, aBase ); @@ -562,7 +561,7 @@ void PrintFontManager::countFontconfigFonts( std::unordered_map<OString, int, OS // not described by fontconfig (e.g. alias names, PSName) if (eFormatRes != FcResultMatch) format = nullptr; - analyzeFontFile( nDirID, aBase, aFonts, reinterpret_cast<char*>(format) ); + std::vector<std::unique_ptr<PrintFont>> aFonts = analyzeFontFile( nDirID, aBase, reinterpret_cast<char*>(format) ); if(aFonts.empty()) { #if OSL_DEBUG_LEVEL > 1 diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx index c7ff4c1f5e45..8336c1738b26 100644 --- a/vcl/unx/generic/fontmanager/fontmanager.cxx +++ b/vcl/unx/generic/fontmanager/fontmanager.cxx @@ -194,8 +194,8 @@ std::vector<fontID> PrintFontManager::addFontFile( const OString& rFileName ) std::vector<fontID> aFontIds = findFontFileIDs( nDirID, aName ); if( aFontIds.empty() ) { - std::list<std::unique_ptr<PrintFont>> aNewFonts; - if (analyzeFontFile(nDirID, aName, aNewFonts)) + std::vector<std::unique_ptr<PrintFont>> aNewFonts = analyzeFontFile(nDirID, aName); + if (!aNewFonts.empty()) { for (auto it = aNewFonts.begin(); it != aNewFonts.end(); ++it) { @@ -214,9 +214,9 @@ enum fontFormat UNKNOWN, TRUETYPE, CFF }; -bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, std::list<std::unique_ptr<PrintFontManager::PrintFont>>& rNewFonts, const char *pFormat ) const +std::vector<std::unique_ptr<PrintFontManager::PrintFont>> PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, const char *pFormat ) const { - rNewFonts.clear(); + std::vector<std::unique_ptr<PrintFontManager::PrintFont>> aNewFonts; OString aDir( getDirectory( nDirID ) ); @@ -226,7 +226,7 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, st // #i1872# reject unreadable files if( access( aFullPath.getStr(), R_OK ) ) - return false; + return aNewFonts; fontFormat eFormat = UNKNOWN; if (pFormat) @@ -290,7 +290,7 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, st xFont->m_aFontFile = rFontFile; xFont->m_nCollectionEntry = i; if (analyzeSfntFile(xFont.get())) - rNewFonts.push_back(std::move(xFont)); + aNewFonts.push_back(std::move(xFont)); } } else @@ -302,10 +302,10 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, st // need to read the font anyway to get aliases inside the font file if (analyzeSfntFile(xFont.get())) - rNewFonts.push_back(std::move(xFont)); + aNewFonts.push_back(std::move(xFont)); } } - return ! rNewFonts.empty(); + return aNewFonts; } fontID PrintFontManager::findFontFileID( int nDirID, const OString& rFontFile, int nFaceIndex ) const |