Kaydet (Commit) 4e41b5be authored tarafından Miklos Vajna's avatar Miklos Vajna

sw android: fix -Werror,-Wsign-compare, take two

This time not breaking other platforms. Thanks to Stephan Bergmann for
suggesting this alternative way.

Change-Id: I2535e57de1aafd17960a1d1054fc58a47933bb58
Reviewed-on: https://gerrit.libreoffice.org/49441Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst 7731b86a
......@@ -3435,7 +3435,8 @@ bool SwTable::SetColWidth( SwTableBox& rAktBox, TableChgWidthHeightType eType,
if( GetFrameFormat()->getIDocumentSettingAccess().get(DocumentSettingId::BROWSE_MODE) &&
!rSz.GetWidthPercent() )
{
bRet = rSz.GetWidth() < USHRT_MAX - nRelDiff;
// silence -Wsign-compare on Android with the static cast
bRet = rSz.GetWidth() < static_cast<unsigned short>(USHRT_MAX) - nRelDiff;
bChgLRSpace = bLeft ? rLR.GetLeft() >= nAbsDiff
: rLR.GetRight() >= nAbsDiff;
}
......@@ -3506,7 +3507,8 @@ bool SwTable::SetColWidth( SwTableBox& rAktBox, TableChgWidthHeightType eType,
if( bBigger )
{
// If the Table does not have any room to grow, we need to create some!
if( aSz.GetWidth() + nRelDiff > USHRT_MAX )
// silence -Wsign-compare on Android with the static cast
if( aSz.GetWidth() + nRelDiff > static_cast<unsigned short>(USHRT_MAX) )
{
// Break down to USHRT_MAX / 2
CR_SetBoxWidth aTmpPara( TableChgWidthHeightType::ColLeft, aSz.GetWidth() / 2,
......
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