diff options
Diffstat (limited to 'toolkit/source/controls/roadmapcontrol.cxx')
-rw-r--r-- | toolkit/source/controls/roadmapcontrol.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/toolkit/source/controls/roadmapcontrol.cxx b/toolkit/source/controls/roadmapcontrol.cxx index 15c5cd7f1f3f..2640dc6b5b67 100644 --- a/toolkit/source/controls/roadmapcontrol.cxx +++ b/toolkit/source/controls/roadmapcontrol.cxx @@ -178,7 +178,7 @@ static void lcl_throwIndexOutOfBoundsException( ) Any SAL_CALL UnoControlRoadmapModel::getByIndex( sal_Int32 Index ) { - if (( Index >= static_cast<sal_Int32>(maRoadmapItems.size())) || (Index < 0)) + if ((Index < 0) || ( o3tl::make_unsigned(Index) >= maRoadmapItems.size())) lcl_throwIndexOutOfBoundsException( ); Any aAny( maRoadmapItems.at( Index ) ); return aAny; @@ -187,7 +187,7 @@ static void lcl_throwIndexOutOfBoundsException( ) void UnoControlRoadmapModel::MakeRMItemValidation( sal_Int32 Index, const Reference< XInterface >& xRoadmapItem ) { - if ((Index > static_cast<sal_Int32>(maRoadmapItems.size())) || ( Index < 0 ) ) + if (( Index < 0 ) || (o3tl::make_unsigned(Index) > maRoadmapItems.size()) ) lcl_throwIndexOutOfBoundsException( ); if ( !xRoadmapItem.is() ) lcl_throwIllegalArgumentException(); @@ -288,7 +288,7 @@ static void lcl_throwIndexOutOfBoundsException( ) void SAL_CALL UnoControlRoadmapModel::removeByIndex( sal_Int32 Index) { - if (( Index > static_cast<sal_Int32>(maRoadmapItems.size())) || (Index < 0)) + if ((Index < 0) || ( o3tl::make_unsigned(Index) > maRoadmapItems.size())) lcl_throwIndexOutOfBoundsException( ); Reference< XInterface > xRoadmapItem; maRoadmapItems.erase( maRoadmapItems.begin() + Index ); |