summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Timofeev <timofeev.i.s@gmail.com>2013-08-17 00:33:57 +0400
committerCaolán McNamara <caolanm@redhat.com>2013-08-17 10:37:03 +0000
commitf5475f4f85bc6cae51cbd4424dcc7a35cc2ef2dc (patch)
tree8c572426a63b14de1b44e864a65e5dadedcbc305
parent823cab696bdaa059e5d1243a636e7d975b2110cc (diff)
fdo#68186: prevent integer underflow
since commit eb1ecd8bc2936e28be852722d6cb0c9fb0baeac4 the Basic Latin subset starts at 0, previously it started at 0x20. Change-Id: I2fe0ee66438b8f11775b1bb8feab547b564622f0 (cherry picked from commit b12e0b522b7f13d15d2ce41dc1e99997c0159d53) Reviewed-on: https://gerrit.libreoffice.org/5469 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-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 23494a87e396..82239d83d52e 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 );