summaryrefslogtreecommitdiffstats
path: root/svx/source
diff options
context:
space:
mode:
authorIvan Timofeev <timofeev.i.s@gmail.com>2013-08-17 00:33:57 +0400
committerIvan Timofeev <timofeev.i.s@gmail.com>2013-08-17 10:22:56 +0400
commitb12e0b522b7f13d15d2ce41dc1e99997c0159d53 (patch)
tree8076bc5f5602bb98bdf60a8e5719652974aaebbe /svx/source
parentUsing ptr_vector for this simplifes it a bit... (diff)
downloadcore-b12e0b522b7f13d15d2ce41dc1e99997c0159d53.tar.gz
core-b12e0b522b7f13d15d2ce41dc1e99997c0159d53.zip
fdo#68186: prevent integer underflow
since commit eb1ecd8bc2936e28be852722d6cb0c9fb0baeac4 the Basic Latin subset starts at 0, previously it started at 0x20. Change-Id: I2fe0ee66438b8f11775b1bb8feab547b564622f0
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/dialog/charmap.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index c68b3928bcf2..4f1cbf621323 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 );