diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-04-03 11:27:05 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-04-03 11:27:05 +0200 |
commit | 8644d10098a10e02c426a4ae80ce179586f35089 (patch) | |
tree | f045e868157e13a409f8559e5112029940f85a17 /svl/source/numbers | |
parent | b8c87dee815d9d20b65fe97e6f838c6937cdf6ab (diff) |
Asserting rtl::O[U]StringBuffer::operator [] preconditions
...and fixing two call-sites.
Change-Id: I8ed8cb189bd5034130b49b2f57156568e6b24716
Diffstat (limited to 'svl/source/numbers')
-rw-r--r-- | svl/source/numbers/zformat.cxx | 4 |
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)'['); |