From 83815bb3907396a95a049e3fd47aff7196e574b0 Mon Sep 17 00:00:00 2001 From: "Herbert Duerr [hdu]" Date: Fri, 2 Jul 2010 14:42:06 +0200 Subject: [PATCH] #i112731# fix off-by-one --- unotools/source/config/fontcfg.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx index d1fb037347a2..e8ae78d0aed2 100644 --- a/unotools/source/config/fontcfg.cxx +++ b/unotools/source/config/fontcfg.cxx @@ -1202,10 +1202,10 @@ const FontNameAttr* FontSubstConfiguration::getSubstInfo( const String& rFontNam 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, aSearchFont.Len() ) == COMPARE_EQUAL ) + // 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; } }