diff options
author | Tor Lillqvist <tml@iki.fi> | 2012-10-10 14:56:29 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2012-10-10 14:59:24 +0300 |
commit | 38968e2963302e650b718e5882ef85ff12f71e40 (patch) | |
tree | 707e74b74c5ca5a6115fe9f67c1893a1c7e6725b /basic | |
parent | 1a969ab932a4d76eabdb867dbc267fece3429ef8 (diff) |
WaE [loplugin]: statement alignment
Change-Id: Ia09c74e02d261de5946e6d7e0530a7913e0bcb8d
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/comp/exprtree.cxx | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx index 710965dd56cb..1a4b465ded02 100644 --- a/basic/source/comp/exprtree.cxx +++ b/basic/source/comp/exprtree.cxx @@ -819,10 +819,22 @@ short SbiConstExpression::GetShortValue() else { double n = nVal; - if( n > 0 ) n += .5; else n -= .5; - if( n > SbxMAXINT ) n = SbxMAXINT, pParser->Error( SbERR_OUT_OF_RANGE ); + if( n > 0 ) + n += .5; else - if( n < SbxMININT ) n = SbxMININT, pParser->Error( SbERR_OUT_OF_RANGE ); + n -= .5; + + if( n > SbxMAXINT ) + { + n = SbxMAXINT; + pParser->Error( SbERR_OUT_OF_RANGE ); + } + else if( n < SbxMININT ) + { + n = SbxMININT; + pParser->Error( SbERR_OUT_OF_RANGE ); + } + return (short) n; } } |