summaryrefslogtreecommitdiff
path: root/svl/source/numbers/zformat.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svl/source/numbers/zformat.cxx')
-rw-r--r--svl/source/numbers/zformat.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index ee1a27d0c690..73cc37c84703 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -1522,7 +1522,9 @@ short SvNumberformat::ImpNextSymbol(OUStringBuffer& rString,
OUString aUpperDBNum( rChrCls().uppercase( rString.toString(), nPos-1, aDBNum.getLength() ) );
sal_Unicode cUpper = aUpperNatNum[0];
sal_Int32 nNatNumNum = rString.toString().copy( nPos - 1 + aNatNum.getLength() ).toInt32();
- sal_Unicode cDBNum = rString[ nPos - 1 + aDBNum.getLength()];
+ sal_Unicode cDBNum =
+ nPos - 1 + aDBNum.getLength() < rString.getLength()
+ ? rString[nPos - 1 + aDBNum.getLength()] : 0;
if ( aUpperNatNum == aNatNum && 0 <= nNatNumNum && nNatNumNum <= 19 )
{
sBuffSymbol.stripStart((sal_Unicode)'[');