diff options
Diffstat (limited to 'vcl/unx/source/fontmanager/fontmanager.cxx')
-rw-r--r-- | vcl/unx/source/fontmanager/fontmanager.cxx | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/vcl/unx/source/fontmanager/fontmanager.cxx b/vcl/unx/source/fontmanager/fontmanager.cxx index 416a48cae2c9..9c59bf9af524 100644 --- a/vcl/unx/source/fontmanager/fontmanager.cxx +++ b/vcl/unx/source/fontmanager/fontmanager.cxx @@ -75,7 +75,7 @@ #include "sal/alloca.h" #include <set> -#include <hash_set> +#include <boost/unordered_set.hpp> #include <algorithm> #include "adobeenc.tab" // get encoding table for AFM metrics @@ -487,8 +487,8 @@ bool PrintFontManager::TrueTypeFontFile::queryMetricPage( int nPage, MultiAtomPr if( pImplTTFont->nkern && pImplTTFont->kerntype == KT_MICROSOFT ) { // create a glyph -> character mapping - ::std::hash_map< sal_uInt16, sal_Unicode > aGlyphMap; - ::std::hash_map< sal_uInt16, sal_Unicode >::iterator left, right; + ::boost::unordered_map< sal_uInt16, sal_Unicode > aGlyphMap; + ::boost::unordered_map< sal_uInt16, sal_Unicode >::iterator left, right; for( i = 21; i < 0xfffd; i++ ) { sal_uInt16 nGlyph = MapChar( pTTFont, (sal_Unicode)i, 0 ); // kerning for horz only @@ -587,8 +587,8 @@ bool PrintFontManager::TrueTypeFontFile::queryMetricPage( int nPage, MultiAtomPr if( pImplTTFont->nkern && pImplTTFont->kerntype == KT_APPLE_NEW ) { // create a glyph -> character mapping - ::std::hash_map< sal_uInt16, sal_Unicode > aGlyphMap; - ::std::hash_map< sal_uInt16, sal_Unicode >::iterator left, right; + ::boost::unordered_map< sal_uInt16, sal_Unicode > aGlyphMap; + ::boost::unordered_map< sal_uInt16, sal_Unicode >::iterator left, right; for( i = 21; i < 0xfffd; i++ ) { sal_uInt16 nGlyph = MapChar( pTTFont, (sal_Unicode)i, 0 ); // kerning for horz only @@ -731,7 +731,7 @@ bool PrintFontManager::TrueTypeFontFile::queryMetricPage( int nPage, MultiAtomPr */ static bool familyNameOverride( const OUString& i_rPSname, OUString& o_rFamilyName ) { - static std::hash_map< OUString, OUString, OUStringHash > aPSNameToFamily( 16 ); + static boost::unordered_map< OUString, OUString, OUStringHash > aPSNameToFamily( 16 ); if( aPSNameToFamily.empty() ) // initialization { aPSNameToFamily[ OUString( RTL_CONSTASCII_USTRINGPARAM( "Helvetica-Narrow" ) ) ] = @@ -743,7 +743,7 @@ static bool familyNameOverride( const OUString& i_rPSname, OUString& o_rFamilyNa aPSNameToFamily[ OUString( RTL_CONSTASCII_USTRINGPARAM( "Helvetica-Narrow-Oblique" ) ) ] = OUString( RTL_CONSTASCII_USTRINGPARAM( "Helvetica Narrow" ) ); } - std::hash_map<OUString,OUString,OUStringHash>::const_iterator it = + boost::unordered_map<OUString,OUString,OUStringHash>::const_iterator it = aPSNameToFamily.find( i_rPSname ); bool bReplaced = (it != aPSNameToFamily.end() ); if( bReplaced ) @@ -1083,8 +1083,8 @@ bool PrintFontManager::PrintFont::readAfmMetrics( const OString& rFileName, Mult } else if( pChar->code != -1 ) { - ::std::pair< ::std::hash_multimap< sal_uInt8, sal_Unicode >::const_iterator, - ::std::hash_multimap< sal_uInt8, sal_Unicode >::const_iterator > + ::std::pair< ::boost::unordered_multimap< sal_uInt8, sal_Unicode >::const_iterator, + ::boost::unordered_multimap< sal_uInt8, sal_Unicode >::const_iterator > aCodes = rManager.getUnicodeFromAdobeCode( pChar->code ); while( aCodes.first != aCodes.second ) { @@ -1192,12 +1192,12 @@ PrintFontManager::PrintFontManager() : { for( unsigned int i = 0; i < SAL_N_ELEMENTS( aAdobeCodes ); i++ ) { - m_aUnicodeToAdobename.insert( ::std::hash_multimap< sal_Unicode, ::rtl::OString >::value_type( aAdobeCodes[i].aUnicode, aAdobeCodes[i].pAdobename ) ); - m_aAdobenameToUnicode.insert( ::std::hash_multimap< ::rtl::OString, sal_Unicode, ::rtl::OStringHash >::value_type( aAdobeCodes[i].pAdobename, aAdobeCodes[i].aUnicode ) ); + m_aUnicodeToAdobename.insert( ::boost::unordered_multimap< sal_Unicode, ::rtl::OString >::value_type( aAdobeCodes[i].aUnicode, aAdobeCodes[i].pAdobename ) ); + m_aAdobenameToUnicode.insert( ::boost::unordered_multimap< ::rtl::OString, sal_Unicode, ::rtl::OStringHash >::value_type( aAdobeCodes[i].pAdobename, aAdobeCodes[i].aUnicode ) ); if( aAdobeCodes[i].aAdobeStandardCode ) { - m_aUnicodeToAdobecode.insert( ::std::hash_multimap< sal_Unicode, sal_uInt8 >::value_type( aAdobeCodes[i].aUnicode, aAdobeCodes[i].aAdobeStandardCode ) ); - m_aAdobecodeToUnicode.insert( ::std::hash_multimap< sal_uInt8, sal_Unicode >::value_type( aAdobeCodes[i].aAdobeStandardCode, aAdobeCodes[i].aUnicode ) ); + m_aUnicodeToAdobecode.insert( ::boost::unordered_multimap< sal_Unicode, sal_uInt8 >::value_type( aAdobeCodes[i].aUnicode, aAdobeCodes[i].aAdobeStandardCode ) ); + m_aAdobecodeToUnicode.insert( ::boost::unordered_multimap< sal_uInt8, sal_Unicode >::value_type( aAdobeCodes[i].aAdobeStandardCode, aAdobeCodes[i].aUnicode ) ); } } } @@ -1207,7 +1207,7 @@ PrintFontManager::PrintFontManager() : PrintFontManager::~PrintFontManager() { deinitFontconfig(); - for( ::std::hash_map< fontID, PrintFont* >::const_iterator it = m_aFonts.begin(); it != m_aFonts.end(); ++it ) + for( ::boost::unordered_map< fontID, PrintFont* >::const_iterator it = m_aFonts.begin(); it != m_aFonts.end(); ++it ) delete (*it).second; delete m_pAtoms; if( m_pFontCache ) @@ -1218,7 +1218,7 @@ PrintFontManager::~PrintFontManager() const OString& PrintFontManager::getDirectory( int nAtom ) const { - ::std::hash_map< int, OString >::const_iterator it( m_aAtomToDir.find( nAtom ) ); + ::boost::unordered_map< int, OString >::const_iterator it( m_aAtomToDir.find( nAtom ) ); return it != m_aAtomToDir.end() ? it->second : s_aEmptyOString; } @@ -1227,7 +1227,7 @@ const OString& PrintFontManager::getDirectory( int nAtom ) const int PrintFontManager::getDirectoryAtom( const OString& rDirectory, bool bCreate ) { int nAtom = 0; - ::std::hash_map< OString, int, OStringHash >::const_iterator it + ::boost::unordered_map< OString, int, OStringHash >::const_iterator it ( m_aDirToAtom.find( rDirectory ) ); if( it != m_aDirToAtom.end() ) nAtom = it->second; @@ -1411,7 +1411,7 @@ bool PrintFontManager::analyzeFontFile( int nDirID, const OString& rFontFile, co fontID PrintFontManager::findFontBuiltinID( int nPSNameAtom ) const { fontID nID = 0; - ::std::hash_map< fontID, PrintFont* >::const_iterator it; + ::boost::unordered_map< fontID, PrintFont* >::const_iterator it; for( it = m_aFonts.begin(); nID == 0 && it != m_aFonts.end(); ++it ) { if( it->second->m_eType == fonttype::Builtin && @@ -1427,12 +1427,12 @@ fontID PrintFontManager::findFontFileID( int nDirID, const OString& rFontFile ) { fontID nID = 0; - ::std::hash_map< OString, ::std::set< fontID >, OStringHash >::const_iterator set_it = m_aFontFileToFontID.find( rFontFile ); + ::boost::unordered_map< OString, ::std::set< fontID >, OStringHash >::const_iterator set_it = m_aFontFileToFontID.find( rFontFile ); if( set_it != m_aFontFileToFontID.end() ) { for( ::std::set< fontID >::const_iterator font_it = set_it->second.begin(); font_it != set_it->second.end() && ! nID; ++font_it ) { - ::std::hash_map< fontID, PrintFont* >::const_iterator it = m_aFonts.find( *font_it ); + ::boost::unordered_map< fontID, PrintFont* >::const_iterator it = m_aFonts.find( *font_it ); if( it != m_aFonts.end() ) { switch( it->second->m_eType ) @@ -2117,7 +2117,7 @@ void PrintFontManager::initialize() // initialize may be called twice in the future { - for( ::std::hash_map< fontID, PrintFont* >::const_iterator it = m_aFonts.begin(); it != m_aFonts.end(); ++it ) + for( ::boost::unordered_map< fontID, PrintFont* >::const_iterator it = m_aFonts.begin(); it != m_aFonts.end(); ++it ) delete (*it).second; m_nNextFontID = 1; m_aFonts.clear(); @@ -2169,7 +2169,7 @@ void PrintFontManager::initialize() } // protect against duplicate paths - std::hash_map< OString, int, OStringHash > visited_dirs; + boost::unordered_map< OString, int, OStringHash > visited_dirs; // now that all global and local font dirs are known to fontconfig // check that there are fonts actually managed by fontconfig @@ -2235,7 +2235,7 @@ void PrintFontManager::initialize() if( pDIR ) { // read fonts.dir if possible - ::std::hash_map< OString, ::std::list<OString>, OStringHash > aFontsDir; + ::boost::unordered_map< OString, ::std::list<OString>, OStringHash > aFontsDir; int nDirID = getDirectoryAtom( aPath, true ); // #i38367# no fonts.dir in our own directories anymore std::list< int >::const_iterator priv_dir; @@ -2283,7 +2283,7 @@ void PrintFontManager::initialize() if( findFontFileID( nDirID, aFileName ) == 0 ) { ::std::list<OString> aXLFDs; - ::std::hash_map< OString, ::std::list<OString>, OStringHash >::const_iterator it = + ::boost::unordered_map< OString, ::std::list<OString>, OStringHash >::const_iterator it = aFontsDir.find( aFileName ); if( it != aFontsDir.end() ) aXLFDs = (*it).second; @@ -2414,10 +2414,10 @@ void PrintFontManager::initialize() #endif // part three - fill in family styles - ::std::hash_map< fontID, PrintFont* >::iterator font_it; + ::boost::unordered_map< fontID, PrintFont* >::iterator font_it; for (font_it = m_aFonts.begin(); font_it != m_aFonts.end(); ++font_it) { - ::std::hash_map< int, family::type >::const_iterator it = + ::boost::unordered_map< int, family::type >::const_iterator it = m_aFamilyTypes.find( font_it->second->m_nFamilyName ); if (it != m_aFamilyTypes.end()) continue; @@ -2515,7 +2515,7 @@ namespace { void PrintFontManager::getFontList( ::std::list< fontID >& rFontIDs, const PPDParser* pParser, bool bUseOverrideMetrics ) { rFontIDs.clear(); - std::hash_map< fontID, PrintFont* >::const_iterator it; + boost::unordered_map< fontID, PrintFont* >::const_iterator it; /* * Note: there are two easy steps making this faster: @@ -2537,7 +2537,7 @@ void PrintFontManager::getFontList( ::std::list< fontID >& rFontIDs, const PPDPa if( pParser ) { std::set<int> aBuiltinPSNames; - std::hash_set< BuiltinFontIdentifier, + boost::unordered_set< BuiltinFontIdentifier, BuiltinFontIdentifierHash > aBuiltinFonts; @@ -2548,7 +2548,7 @@ void PrintFontManager::getFontList( ::std::list< fontID >& rFontIDs, const PPDPa for( std::vector<fontID>::const_iterator over = m_aOverrideFonts.begin(); over != m_aOverrideFonts.end(); ++over ) { - std::hash_map<fontID,PrintFont*>::const_iterator font_it = m_aFonts.find( *over ); + boost::unordered_map<fontID,PrintFont*>::const_iterator font_it = m_aFonts.find( *over ); DBG_ASSERT( font_it != m_aFonts.end(), "override to nonexistant font" ); if( font_it != m_aFonts.end() ) aOverridePSNames[ font_it->second->m_nPSName ] = *over; @@ -2638,7 +2638,7 @@ void PrintFontManager::getFontList( ::std::list< fontID >& rFontIDs, const PPDPa void PrintFontManager::fillPrintFontInfo( PrintFont* pFont, FastPrintFontInfo& rInfo ) const { - ::std::hash_map< int, family::type >::const_iterator style_it = + ::boost::unordered_map< int, family::type >::const_iterator style_it = m_aFamilyTypes.find( pFont->m_nFamilyName ); rInfo.m_eType = pFont->m_eType; rInfo.m_aFamilyName = m_pAtoms->getString( ATOM_FAMILYNAME, pFont->m_nFamilyName ); @@ -2855,7 +2855,7 @@ family::type PrintFontManager::getFontFamilyType( fontID nFontID ) const if( !pFont ) return family::Unknown; - ::std::hash_map< int, family::type >::const_iterator it = + ::boost::unordered_map< int, family::type >::const_iterator it = m_aFamilyTypes.find( pFont->m_nFamilyName ); return (it != m_aFamilyTypes.end()) ? it->second : family::Unknown; } @@ -2909,7 +2909,7 @@ OString PrintFontManager::getFontFile( PrintFont* pFont ) const if( pFont && pFont->m_eType == fonttype::Type1 ) { Type1FontFile* pPSFont = static_cast< Type1FontFile* >(pFont); - ::std::hash_map< int, OString >::const_iterator it = m_aAtomToDir.find( pPSFont->m_nDirectory ); + ::boost::unordered_map< int, OString >::const_iterator it = m_aAtomToDir.find( pPSFont->m_nDirectory ); aPath = it->second; aPath += "/"; aPath += pPSFont->m_aFontFile; @@ -2917,7 +2917,7 @@ OString PrintFontManager::getFontFile( PrintFont* pFont ) const else if( pFont && pFont->m_eType == fonttype::TrueType ) { TrueTypeFontFile* pTTFont = static_cast< TrueTypeFontFile* >(pFont); - ::std::hash_map< int, OString >::const_iterator it = m_aAtomToDir.find( pTTFont->m_nDirectory ); + ::boost::unordered_map< int, OString >::const_iterator it = m_aAtomToDir.find( pTTFont->m_nDirectory ); aPath = it->second; aPath += "/"; aPath += pTTFont->m_aFontFile; @@ -3031,7 +3031,7 @@ void PrintFontManager::hasVerticalSubstitutions( fontID nFontID, if( ! pFont->m_pMetrics || ! ( pFont->m_pMetrics->m_aPages[ code >> 11 ] & ( 1 << ( ( code >> 8 ) & 7 ) ) ) ) pFont->queryMetricPage( code >> 8, m_pAtoms ); - ::std::hash_map< sal_Unicode, bool >::const_iterator it = pFont->m_pMetrics->m_bVerticalSubstitutions.find( code ); + ::boost::unordered_map< sal_Unicode, bool >::const_iterator it = pFont->m_pMetrics->m_bVerticalSubstitutions.find( code ); pHasSubst[i] = it != pFont->m_pMetrics->m_bVerticalSubstitutions.end(); } } @@ -3136,7 +3136,7 @@ bool PrintFontManager::getMetrics( fontID nFontID, const sal_Unicode* pString, i { int effectiveCode = pString[i]; effectiveCode |= bVertical ? 1 << 16 : 0; - ::std::hash_map< int, CharacterMetric >::const_iterator it = + ::boost::unordered_map< int, CharacterMetric >::const_iterator it = pFont->m_pMetrics->m_aMetrics.find( effectiveCode ); // if no vertical metrics are available assume rotated horizontal metrics if( bVertical && (it == pFont->m_pMetrics->m_aMetrics.end()) ) @@ -3181,7 +3181,7 @@ bool PrintFontManager::getMetrics( fontID nFontID, sal_Unicode minCharacter, sal { int effectiveCode = code; effectiveCode |= bVertical ? 1 << 16 : 0; - ::std::hash_map< int, CharacterMetric >::const_iterator it = + ::boost::unordered_map< int, CharacterMetric >::const_iterator it = pFont->m_pMetrics->m_aMetrics.find( effectiveCode ); // if no vertical metrics are available assume rotated horizontal metrics if( bVertical && (it == pFont->m_pMetrics->m_aMetrics.end()) ) @@ -3340,7 +3340,7 @@ int PrintFontManager::importFonts( const ::std::list< OString >& rFiles, bool bL { // remove all fonts for the same file // discarding their font ids - ::std::hash_map< fontID, PrintFont* >::iterator current, next; + ::boost::unordered_map< fontID, PrintFont* >::iterator current, next; current = m_aFonts.begin(); OString aFileName( OUStringToOString( aTo.GetName(), aEncoding ) ); while( current != m_aFonts.end() ) @@ -3496,7 +3496,7 @@ bool PrintFontManager::getFileDuplicates( fontID nFont, ::std::list< fontID >& r if( ! aFile.getLength() ) return false; - for( ::std::hash_map< fontID, PrintFont* >::const_iterator it = m_aFonts.begin(); it != m_aFonts.end(); ++it ) + for( ::boost::unordered_map< fontID, PrintFont* >::const_iterator it = m_aFonts.begin(); it != m_aFonts.end(); ++it ) { if( nFont != it->first ) { @@ -3519,7 +3519,7 @@ bool PrintFontManager::removeFonts( const ::std::list< fontID >& rFonts ) ::std::list< fontID > aDuplicates; for( ::std::list< fontID >::const_iterator it = rFonts.begin(); it != rFonts.end(); ++it ) { - ::std::hash_map< fontID, PrintFont* >::const_iterator haveFont = m_aFonts.find( *it ); + ::boost::unordered_map< fontID, PrintFont* >::const_iterator haveFont = m_aFonts.find( *it ); if( haveFont == m_aFonts.end() ) continue; @@ -3855,7 +3855,7 @@ void PrintFontManager::getGlyphWidths( fontID nFont, rUnicodeEnc.clear(); rWidths.clear(); rWidths.reserve( pFont->m_pMetrics->m_aMetrics.size() ); - for( std::hash_map< int, CharacterMetric >::const_iterator it = + for( boost::unordered_map< int, CharacterMetric >::const_iterator it = pFont->m_pMetrics->m_aMetrics.begin(); it != pFont->m_pMetrics->m_aMetrics.end(); ++it ) { @@ -3892,8 +3892,8 @@ const std::map< sal_Unicode, sal_Int32 >* PrintFontManager::getEncodingMap( font std::list< OString > PrintFontManager::getAdobeNameFromUnicode( sal_Unicode aChar ) const { - std::pair< std::hash_multimap< sal_Unicode, rtl::OString >::const_iterator, - std::hash_multimap< sal_Unicode, rtl::OString >::const_iterator > range + std::pair< boost::unordered_multimap< sal_Unicode, rtl::OString >::const_iterator, + boost::unordered_multimap< sal_Unicode, rtl::OString >::const_iterator > range = m_aUnicodeToAdobename.equal_range( aChar ); std::list< OString > aRet; @@ -3913,8 +3913,8 @@ std::list< OString > PrintFontManager::getAdobeNameFromUnicode( sal_Unicode aCha // ------------------------------------------------------------------------- std::list< sal_Unicode > PrintFontManager::getUnicodeFromAdobeName( const rtl::OString& rName ) const { - std::pair< std::hash_multimap< rtl::OString, sal_Unicode, rtl::OStringHash >::const_iterator, - std::hash_multimap< rtl::OString, sal_Unicode, rtl::OStringHash >::const_iterator > range + std::pair< boost::unordered_multimap< rtl::OString, sal_Unicode, rtl::OStringHash >::const_iterator, + boost::unordered_multimap< rtl::OString, sal_Unicode, rtl::OStringHash >::const_iterator > range = m_aAdobenameToUnicode.equal_range( rName ); std::list< sal_Unicode > aRet; |