[Libreoffice-commits] core.git: svx/source

Ivan Timofeev timofeev.i.s at gmail.com
Fri Aug 16 23:24:35 PDT 2013


 svx/source/dialog/charmap.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b12e0b522b7f13d15d2ce41dc1e99997c0159d53
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date:   Sat Aug 17 00:33:57 2013 +0400

    fdo#68186: prevent integer underflow
    
    since commit eb1ecd8bc2936e28be852722d6cb0c9fb0baeac4 the Basic Latin subset
    starts at 0, previously it started at 0x20.
    
    Change-Id: I2fe0ee66438b8f11775b1bb8feab547b564622f0

diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index c68b392..4f1cbf6 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -650,7 +650,7 @@ void SvxShowCharSet::SelectIndex( int nNewIndex, sal_Bool bFocus )
 void SvxShowCharSet::SelectCharacter( sal_UCS4 cNew, sal_Bool bFocus )
 {
     // get next available char of current font
-    sal_UCS4 cNext = maFontCharMap.GetNextChar( cNew - 1 );
+    sal_UCS4 cNext = maFontCharMap.GetNextChar( (cNew > 0) ? cNew - 1 : cNew );
 
     int nMapIndex = maFontCharMap.GetIndexFromChar( cNext );
     SelectIndex( nMapIndex, bFocus );


More information about the Libreoffice-commits mailing list