diff options
author | Mathias Bauer <mba@openoffice.org> | 2010-07-22 10:55:12 +0200 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2010-07-22 10:55:12 +0200 |
commit | 2c2a74a576e35b3a142804cd35de75dbc086bcd3 (patch) | |
tree | 7b6512155c00e266d6b461ab40bcc61ee06dea46 /unotools/source | |
parent | 70146da8808a0aeb48bda3bb837711fa3a812042 (diff) | |
parent | 32c76a4434c49e687c0a6e955f521586f9c75be5 (diff) |
CWS changehid: resync to m85
Diffstat (limited to 'unotools/source')
-rw-r--r-- | unotools/source/config/fontcfg.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx index a1d287337bea..e8ae78d0aed2 100644 --- a/unotools/source/config/fontcfg.cxx +++ b/unotools/source/config/fontcfg.cxx @@ -1199,8 +1199,15 @@ const FontNameAttr* FontSubstConfiguration::getSubstInfo( const String& rFontNam // try to find an exact match // because the list is sorted this will also find fontnames of the form searchfontname* std::vector< FontNameAttr >::const_iterator it = ::std::lower_bound( lang->second.aSubstAttributes.begin(), lang->second.aSubstAttributes.end(), aSearchAttr, StrictStringSort() ); - if( it != lang->second.aSubstAttributes.end() && aSearchFont.CompareTo( it->Name, aSearchFont.Len() ) == COMPARE_EQUAL ) - return &(*it); + if( it != lang->second.aSubstAttributes.end()) + { + const FontNameAttr& rFoundAttr = *it; + // a search for "abcblack" may match with an entry for "abc" + // the reverse is not a good idea (e.g. #i112731# alba->albani) + if( rFoundAttr.Name.Len() <= aSearchFont.Len() ) + if( aSearchFont.CompareTo( rFoundAttr.Name, rFoundAttr.Name.Len() ) == COMPARE_EQUAL ) + return &rFoundAttr; + } } // gradually become more unspecific if( aLocale.Variant.getLength() ) |