From 6eddd1b54cb6fc21cdc6883eee708d1247d15f9d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 11 Jan 2012 11:42:25 +0000 Subject: further shrinkage of padmin non-fontconfig code-paths --- vcl/generic/fontmanager/fontmanager.cxx | 90 --------------------------------- 1 file changed, 90 deletions(-) (limited to 'vcl/generic') 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(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; -- cgit