From 3a5b8e039dcb6cfe68505de3440c4bcdaeb7a94a Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sun, 26 Jan 2020 14:59:23 +0100 Subject: Avoid explicit casts to smaller sal_uInt16 from larger int ...in what might be attempts to avoid warnings about signed vs. unsigned comparisons. Change-Id: I8eceaa989c35558e37cb815d997dda88d17c22b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87444 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'dbaccess') diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index f0f383b126e2..7fd11331b640 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -40,6 +40,7 @@ #include "QueryDesignFieldUndoAct.hxx" #include #include +#include #include #include #include @@ -289,7 +290,7 @@ void OSelectionBrowseBox::ColumnMoved( sal_uInt16 nColId, bool _bCreateUndo ) // swap the two columns sal_uInt16 nNewPos = GetColumnPos( nColId ); OTableFields& rFields = getFields(); - if ( rFields.size() > sal_uInt16(nNewPos-1) ) + if ( rFields.size() > o3tl::make_unsigned(nNewPos-1) ) { sal_uInt16 nOldPos = 0; bool bFoundElem = false; @@ -888,7 +889,7 @@ bool OSelectionBrowseBox::SaveModified() OQueryController& rController = static_cast(getDesignView()->getController()); OTableFieldDescRef pEntry; sal_uInt16 nCurrentColumnPos = GetColumnPos(GetCurColumnId()); - if(getFields().size() > static_cast(nCurrentColumnPos - 1)) + if(getFields().size() > o3tl::make_unsigned(nCurrentColumnPos - 1)) pEntry = getEntry(nCurrentColumnPos - 1); bool bWasEmpty = pEntry.is() && pEntry->IsEmpty(); @@ -1213,7 +1214,7 @@ void OSelectionBrowseBox::PaintCell(OutputDevice& rDev, const tools::Rectangle& OTableFieldDescRef pEntry; sal_uInt16 nPos = GetColumnPos(nColumnId); - if(getFields().size() > sal_uInt16(nPos - 1)) + if(getFields().size() > o3tl::make_unsigned(nPos - 1)) pEntry = getFields()[nPos - 1]; if (!pEntry.is()) @@ -1278,7 +1279,7 @@ void OSelectionBrowseBox::RemoveField(sal_uInt16 nColumnId ) OQueryController& rController = static_cast(getDesignView()->getController()); sal_uInt16 nPos = GetColumnPos(nColumnId); - OSL_ENSURE(getFields().size() > sal_uInt16(nPos-1),"ID is to great!"); + OSL_ENSURE(getFields().size() > o3tl::make_unsigned(nPos-1),"ID is to great!"); OTableFieldDescRef pDesc = getEntry(static_cast(nPos - 1)) ; pDesc->SetColWidth( static_cast(GetColumnWidth(nColumnId)) ); // was not stored this before @@ -2642,7 +2643,7 @@ void OSelectionBrowseBox::setFunctionCell(OTableFieldDescRef const & _pEntry) Reference< XAccessible > OSelectionBrowseBox::CreateAccessibleCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) { OTableFieldDescRef pEntry; - if(getFields().size() > sal_uInt16(_nColumnPos - 1)) + if(getFields().size() > o3tl::make_unsigned(_nColumnPos - 1)) pEntry = getFields()[_nColumnPos - 1]; if ( _nRow == BROW_VIS_ROW && pEntry.is() ) -- cgit