diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-01-26 14:59:23 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-01-26 17:36:10 +0100 |
commit | 3a5b8e039dcb6cfe68505de3440c4bcdaeb7a94a (patch) | |
tree | 0018cd5c2c139952e3f9fa61d8072b5e48260e87 /dbaccess | |
parent | a7f50a30abd0ed51ca1fd053e1cc726558e00cb0 (diff) |
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 <sbergman@redhat.com>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
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 <sqlmessage.hxx> #include <UITools.hxx> +#include <o3tl/safeint.hxx> #include <osl/diagnose.h> #include <i18nlangtag/languagetag.hxx> #include <vcl/treelistentry.hxx> @@ -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<OQueryController&>(getDesignView()->getController()); OTableFieldDescRef pEntry; sal_uInt16 nCurrentColumnPos = GetColumnPos(GetCurColumnId()); - if(getFields().size() > static_cast<sal_uInt16>(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<OQueryController&>(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<sal_uInt32>(nPos - 1)) ; pDesc->SetColWidth( static_cast<sal_uInt16>(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() ) |