summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-02-21 18:56:29 +0100
committerEike Rathke <erack@redhat.com>2013-02-21 18:58:44 +0100
commitb9a51c0b1e000865921e0bd4b84827e6f6f12556 (patch)
treecaaa3a3723548f47bec45624a6413c1de64b9258 /sc
parent9287760846655c85a564c5b8b546770762121a43 (diff)
assert "can't happen"
Change-Id: I896e29b04568b351517612a1ac161dca5717dfbc
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/interpr2.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 7326497912ab..9279c18aa2e7 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -2575,6 +2575,9 @@ void ScInterpreter::ScRoman()
if( (nDigit % 5) == 4 )
{
+ // assert can't happen with nVal<4000 precondition
+ assert( ((nDigit == 4) ? (nIndex >= 1) : (nIndex >= 2)));
+
sal_uInt16 nIndex2 = (nDigit == 4) ? nIndex - 1 : nIndex - 2;
sal_uInt16 nSteps = 0;
while( (nSteps < nMode) && (nIndex < nMaxIndex) )
@@ -2593,7 +2596,11 @@ void ScInterpreter::ScRoman()
else
{
if( nDigit > 4 )
+ {
+ // assert can't happen with nVal<4000 precondition
+ assert( nIndex >= 1 );
aRoman += pChars[ nIndex - 1 ];
+ }
sal_Int32 nPad = nDigit % 5;
if (nPad)
{