diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-01-26 14:56:56 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-01-26 15:51:51 +0100 |
commit | b2945902e7a0ad9f033fe67f5ab217d6e31d8d84 (patch) | |
tree | 3296f66d63d25db54aec1345b55f81476eac5ff1 /sfx2 | |
parent | 0f6bbde666382f1517e8ba7d94e692a86ebca28b (diff) |
Avoid explicit casts to smaller sal_uInt16 from larger long
...in what might be attempts to avoid warnings about signed vs. unsigned
comparisons.
Change-Id: I699718a90dffb4b5bcd3706eddbaf6fba71114fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87442
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/thumbnailview.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index 56cf4213b51d..ba829574d6a3 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -21,6 +21,7 @@ #include <drawinglayer/primitive2d/textlayoutdevice.hxx> #include <drawinglayer/processor2d/baseprocessor2d.hxx> #include <drawinglayer/processor2d/processorfromoutputdevice.hxx> +#include <o3tl/safeint.hxx> #include <rtl/ustring.hxx> #include <sal/log.hxx> #include <svtools/optionsdrawinglayer.hxx> @@ -290,7 +291,7 @@ void ThumbnailView::CalculateItemPositions (bool bScrollBarUsed) if ( mnLines <= mnVisLines ) mnFirstLine = 0; - else if ( mnFirstLine > static_cast<sal_uInt16>(mnLines-mnVisLines) ) + else if ( mnFirstLine > o3tl::make_unsigned(mnLines-mnVisLines) ) mnFirstLine = static_cast<sal_uInt16>(mnLines-mnVisLines); mbHasVisibleItems = true; @@ -1007,7 +1008,7 @@ void ThumbnailView::SelectItem( sal_uInt16 nItemId ) { mnFirstLine = nNewLine; } - else if ( nNewLine > static_cast<sal_uInt16>(mnFirstLine+mnVisLines-1) ) + else if ( nNewLine > o3tl::make_unsigned(mnFirstLine+mnVisLines-1) ) { mnFirstLine = static_cast<sal_uInt16>(nNewLine-mnVisLines+1); } @@ -1444,7 +1445,7 @@ void SfxThumbnailView::CalculateItemPositions(bool bScrollBarUsed) if ( mnLines <= mnVisLines ) mnFirstLine = 0; - else if ( mnFirstLine > static_cast<sal_uInt16>(mnLines-mnVisLines) ) + else if ( mnFirstLine > o3tl::make_unsigned(mnLines-mnVisLines) ) mnFirstLine = static_cast<sal_uInt16>(mnLines-mnVisLines); mbHasVisibleItems = true; @@ -2175,7 +2176,7 @@ void SfxThumbnailView::SelectItem( sal_uInt16 nItemId ) { mnFirstLine = nNewLine; } - else if ( nNewLine > static_cast<sal_uInt16>(mnFirstLine+mnVisLines-1) ) + else if ( nNewLine > o3tl::make_unsigned(mnFirstLine+mnVisLines-1) ) { mnFirstLine = static_cast<sal_uInt16>(nNewLine-mnVisLines+1); } |