diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-06-19 08:56:47 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-19 10:26:49 +0100 |
commit | 7c97720c2e1164ff41e5eb0218dd1f5543dd4d1f (patch) | |
tree | 26d89e13d6bd2d1ba9c16ce04147fd5cd2ddf8f7 /sw | |
parent | 0e09134a4a4cbb0639fc586c560c6fb2765487be (diff) |
coverity#706103 Unintended sign extension
Change-Id: Icc0161f80982a9cab5776981a4848ea48709ecd2
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/itrform2.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 253f174be156..abbfecafc3c4 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -649,12 +649,11 @@ void SwTxtFormatter::BuildPortions( SwTxtFormatInfo &rInf ) pTmpPor = pTmpPor->GetPortion(); } - const sal_uInt16 i = nSumWidth ? + const SwTwips i = nSumWidth ? ( nSumWidth - 1 ) / nGridWidth + 1 : 0; const SwTwips nTmpWidth = i * nGridWidth; - const SwTwips nKernWidth = std::min( (SwTwips)(nTmpWidth - nSumWidth), - nRestWidth ); + const SwTwips nKernWidth = std::min(nTmpWidth - nSumWidth, nRestWidth); const sal_uInt16 nKernWidth_1 = (sal_uInt16)(nKernWidth / 2); OSL_ENSURE( nKernWidth <= nRestWidth, |