diff options
Diffstat (limited to 'toolkit/source/controls/grid/sortablegriddatamodel.cxx')
-rw-r--r-- | toolkit/source/controls/grid/sortablegriddatamodel.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/toolkit/source/controls/grid/sortablegriddatamodel.cxx b/toolkit/source/controls/grid/sortablegriddatamodel.cxx index 711c7c23fa8d..ffbb6528dc62 100644 --- a/toolkit/source/controls/grid/sortablegriddatamodel.cxx +++ b/toolkit/source/controls/grid/sortablegriddatamodel.cxx @@ -38,6 +38,7 @@ #include <cppuhelper/supportsservice.hxx> #include <tools/diagnose_ex.h> #include <i18nlangtag/languagetag.hxx> +#include <o3tl/safeint.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> @@ -437,7 +438,7 @@ void lcl_clear( STLCONTAINER& i_container ) OSL_ENSURE( false, "SortableGridDataModel::rowsRemoved: missing implementation - removal of multiple rows!" ); needReIndex = true; } - else if ( size_t( i_event.FirstRow ) >= m_privateToPublicRowIndex.size() ) + else if ( o3tl::make_unsigned( i_event.FirstRow ) >= m_privateToPublicRowIndex.size() ) { OSL_ENSURE( false, "SortableGridDataModel::rowsRemoved: inconsistent/wrong data!" ); needReIndex = true; @@ -891,7 +892,7 @@ void lcl_clear( STLCONTAINER& i_container ) // no need to translate anything return i_publicRowIndex; - ENSURE_OR_RETURN( size_t( i_publicRowIndex ) < m_publicToPrivateRowIndex.size(), + ENSURE_OR_RETURN( o3tl::make_unsigned( i_publicRowIndex ) < m_publicToPrivateRowIndex.size(), "SortableGridDataModel::impl_getPrivateRowIndex_throw: inconsistency!", i_publicRowIndex ); // obviously the translation table contains too few elements - it should have exactly |getRowCount()| // elements @@ -909,7 +910,7 @@ void lcl_clear( STLCONTAINER& i_container ) if ( i_privateRowIndex < 0 ) return i_privateRowIndex; - ENSURE_OR_RETURN( size_t( i_privateRowIndex ) < m_privateToPublicRowIndex.size(), + ENSURE_OR_RETURN( o3tl::make_unsigned( i_privateRowIndex ) < m_privateToPublicRowIndex.size(), "SortableGridDataModel::impl_getPublicRowIndex_nothrow: invalid index!", i_privateRowIndex ); return m_privateToPublicRowIndex[ i_privateRowIndex ]; |