Kaydet (Commit) 5e363a45 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Avoid explicit narrowing casts

They had been added back in the day with
0c0c6f27 "INTEGRATION: CWS swwarnings"
(adressing "#i69287# warning-free code"), but don't seem to actually silence any
warnings, at least nowadays.  Better to keep such narrowing casts implicit, so
that tools like Clang's -fsanitize=implicit-integer-truncation can detect cases
at runtime where a too-large value erroneously gets truncated by such a cast.

Change-Id: I3bba6fff034e544cd935c0c4dbc98989052add5e
Reviewed-on: https://gerrit.libreoffice.org/68541
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 5f4df4b3
......@@ -1088,10 +1088,10 @@ bool SwFormatCol::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
for(sal_uInt16 i = 0; i < nCount; i++)
{
SwColumn aCol;
aCol.SetWishWidth(static_cast<sal_uInt16>(pArray[i].Width) );
nWidthSum = static_cast<sal_uInt16>(nWidthSum + pArray[i].Width);
aCol.SetLeft (static_cast<sal_uInt16>(convertMm100ToTwip(pArray[i].LeftMargin)));
aCol.SetRight(static_cast<sal_uInt16>(convertMm100ToTwip(pArray[i].RightMargin)));
aCol.SetWishWidth(pArray[i].Width );
nWidthSum = nWidthSum + pArray[i].Width;
aCol.SetLeft (convertMm100ToTwip(pArray[i].LeftMargin));
aCol.SetRight(convertMm100ToTwip(pArray[i].RightMargin));
m_aColumns.insert(m_aColumns.begin() + i, aCol);
}
bRet = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment