diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-05-11 17:42:24 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-05-11 21:05:53 +0100 |
commit | a59a897fa542e40baf4991625c3f3cd66e20d088 (patch) | |
tree | c83a2c1867041064b01965e54fcff6b4507ee10e | |
parent | 867aa217e6bcb543ea61c61f10088042d632bd07 (diff) |
coverity#705435 Improper use of negative value
Change-Id: I590f7ae2b367242b5672d79b1c9c3d6661830564
-rw-r--r-- | sw/source/filter/ww8/wrtw8nds.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 68129234e555..5f86a02e4a14 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2447,7 +2447,16 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) // new left margin = old left + label space const SwNumRule* pRule = rNode.GetNumRule(); - const SwNumFmt& rNumFmt = pRule->Get( static_cast< sal_uInt16 >(rNode.GetActualListLevel()) ); + int nLevel = rNode.GetActualListLevel(); + + if (nLevel < 0) + nLevel = 0; + + if (nLevel >= MAXLEVEL) + nLevel = MAXLEVEL - 1; + + const SwNumFmt& rNumFmt = pRule->Get( static_cast< sal_uInt16 >(nLevel) ); + // #i86652# if ( rNumFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) |