diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-01-11 11:42:25 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-01-11 14:13:32 +0000 |
commit | 6eddd1b54cb6fc21cdc6883eee708d1247d15f9d (patch) | |
tree | 47d78be7322dbd8771a0206ffee66c4a0c137b55 /vcl | |
parent | 44cf768131e8a06ff688ddfa8b53f144ffb9e4a0 (diff) |
further shrinkage of padmin non-fontconfig code-paths
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/generic/fontmanager/fontmanager.cxx | 90 | ||||
-rw-r--r-- | vcl/inc/vcl/fontmanager.hxx | 5 |
2 files changed, 0 insertions, 95 deletions
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx index 5ca8694704e8..e99044e62c11 100644 --- a/vcl/generic/fontmanager/fontmanager.cxx +++ b/vcl/generic/fontmanager/fontmanager.cxx @@ -3471,96 +3471,6 @@ getImportableFontProperties( // ------------------------------------------------------------------------- -bool PrintFontManager::getFileDuplicates( fontID nFont, ::std::list< fontID >& rFonts ) const -{ - bool bRet = false; - - rFonts.clear(); - - PrintFont* pSearchFont = getFont( nFont ); - if( ! pSearchFont || - pSearchFont->m_eType != fonttype::TrueType || - static_cast<TrueTypeFontFile*>(pSearchFont)->m_nCollectionEntry == -1 - ) - return false; - - OString aFile( getFontFileSysPath( nFont ) ); - if( ! aFile.getLength() ) - return false; - - for( ::boost::unordered_map< fontID, PrintFont* >::const_iterator it = m_aFonts.begin(); it != m_aFonts.end(); ++it ) - { - if( nFont != it->first ) - { - OString aCompFile( getFontFile( it->second ) ); - if( aCompFile == aFile ) - { - rFonts.push_back( it->first ); - bRet = true; - } - } - } - return bRet; -} - -// ------------------------------------------------------------------------- - -bool PrintFontManager::removeFonts( const ::std::list< fontID >& rFonts ) -{ - bool bRet = true; - ::std::list< fontID > aDuplicates; - for( ::std::list< fontID >::const_iterator it = rFonts.begin(); it != rFonts.end(); ++it ) - { - ::boost::unordered_map< fontID, PrintFont* >::const_iterator haveFont = m_aFonts.find( *it ); - if( haveFont == m_aFonts.end() ) - continue; - - PrintFont* pFont = haveFont->second; - bool bRemoveDuplicates = getFileDuplicates( *it, aDuplicates ); - ByteString aFile( getFontFile( pFont ) ); - if( aFile.Len() ) - { -#if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "try unlink( \"%s\" ) ... ", aFile.GetBuffer() ); -#endif - if( unlink( aFile.GetBuffer() ) ) - { - bRet = false; -#if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "failed\n" ); -#endif - continue; - } -#if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "succeeded\n" ); -#endif - OString aAfm( getAfmFile( pFont ) ); - if( aAfm.getLength() ) - { -#if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "unlink( \"%s\" )\n", aAfm.getStr() ); -#endif - unlink( aAfm.getStr() ); - } - m_aFonts.erase( *it ); - delete pFont; - if( bRemoveDuplicates ) - { - for( ::std::list< fontID >::iterator dup = aDuplicates.begin(); dup != aDuplicates.end(); ++dup ) - { - m_aFontFileToFontID[ aFile ].erase( *dup ); - PrintFont* pDup = m_aFonts[ *dup ]; - m_aFonts.erase( *dup ); - delete pDup; - } - } - } - } - return bRet; -} - -// ------------------------------------------------------------------------- - bool PrintFontManager::isPrivateFontFile( fontID nFont ) const { bool bRet = false; diff --git a/vcl/inc/vcl/fontmanager.hxx b/vcl/inc/vcl/fontmanager.hxx index f9708c316a64..6a522c15eda3 100644 --- a/vcl/inc/vcl/fontmanager.hxx +++ b/vcl/inc/vcl/fontmanager.hxx @@ -607,11 +607,6 @@ public: // get properties of a not imported font file bool getImportableFontProperties( const rtl::OString& rFile, std::list< FastPrintFontInfo >& rFontProps ); - // get fonts that come from the same font file - bool getFileDuplicates( fontID nFont, std::list< fontID >& rFonts ) const; - // remove font files - bool removeFonts( const std::list< fontID >& rFonts ); - bool isPrivateFontFile( fontID ) const; // returns false if there were not any |