summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-04-16 17:44:56 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-04-16 17:45:12 +0200
commitd67da1e7216a1b1281f418ecaa067cd3014e47c0 (patch)
treec7547bd271aa2a2600ca10ddc5c03c63b2dd1c91 /unotools
parentbcbf14f6077b0ccf1179dcba3e382bda4f9bdcad (diff)
Remove FontNameHash, use standard OUStringHash
Change-Id: If123bbe8a4ee044ef45f418be0118ccf9509f4e7
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/misc/fontdefs.cxx24
1 files changed, 1 insertions, 23 deletions
diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx
index 0f4206e6c2e6..61f6a0716bed 100644
--- a/unotools/source/misc/fontdefs.cxx
+++ b/unotools/source/misc/fontdefs.cxx
@@ -423,7 +423,7 @@ void GetEnglishSearchFontName( OUString& rName )
// translate normalized localized name to its normalized English ASCII name
if( bNeedTranslation )
{
- typedef boost::unordered_map<const OUString, const char*, FontNameHash> FontNameDictionary;
+ typedef boost::unordered_map<const OUString, const char*, OUStringHash> FontNameDictionary;
static FontNameDictionary aDictionary( SAL_N_ELEMENTS(aImplLocalizedNamesList) );
// the font name dictionary needs to be intialized once
if( aDictionary.empty() )
@@ -568,28 +568,6 @@ OUString GetSubsFontName( const OUString& rName, sal_uLong nFlags )
return aName;
}
-// TODO: use a more generic String hash
-int FontNameHash::operator()( const OUString& rStr ) const
-{
- // this simple hash just has to be good enough for font names
- int nHash = 0;
- const int nLen = rStr.getLength();
- const sal_Unicode* p = rStr.getStr();
- switch( nLen )
- {
- default: nHash = (p[0]<<16) - (p[1]<<8) + p[2];
- nHash += nLen;
- p += nLen - 3;
- // fall through
- case 3: nHash += (p[2]<<16); // fall through
- case 2: nHash += (p[1]<<8); // fall through
- case 1: nHash += p[0]; // fall through
- case 0: break;
- };
-
- return nHash;
-}
-
bool IsStarSymbol(const OUString &rFontName)
{
sal_Int32 nIndex = 0;