diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-02-08 16:24:18 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-02-09 09:05:50 +0100 |
commit | 4e41b5be785673754d433b77e0925e701cac18df (patch) | |
tree | 668f3acaa0d0482f4516954dbaea4c53656fcd7e | |
parent | 7731b86a12811b6903d29e29bb867a316c94bccc (diff) |
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/49441
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
-rw-r--r-- | sw/source/core/doc/tblrwcl.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index 889aea171ce1..e15078e58628 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -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, |