summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorHerbert Duerr [hdu] <duerr@sun.com>2010-07-02 12:31:38 +0200
committerHerbert Duerr [hdu] <duerr@sun.com>2010-07-02 12:31:38 +0200
commitf9dc559631798dca006c64f69b531cb2f8f34167 (patch)
tree9207b80ec43adc58d5e8af567abb7e1ff64bd5d2 /vcl
parentbe588658ea127a6a05390435126f1d739a477b58 (diff)
#i112144# ignore trivial fontname substring matches
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/outdev3.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 949d3df5275f..f0ad6f819133 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -1889,7 +1889,8 @@ ImplDevFontListData* ImplDevFontList::ImplFindByAttributes( ULONG nSearchType,
nTestMatch -= 1000000;
// test font name substrings
- if( (rSearchFamilyName.Len() && pData->maMatchFamilyName.Len())
+ // TODO: calculate name matching score using e.g. Levenstein distance
+ if( (rSearchFamilyName.Len() >= 4) && (pData->maMatchFamilyName.Len() >= 4)
&& ((rSearchFamilyName.Search( pData->maMatchFamilyName ) != STRING_NOTFOUND)
|| (pData->maMatchFamilyName.Search( rSearchFamilyName ) != STRING_NOTFOUND)) )
nTestMatch += 100000*2;