summaryrefslogtreecommitdiff
path: root/toolkit/source/controls/tabpagecontainer.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-05-03 14:39:50 +0200
committerStephan Bergmann <sbergman@redhat.com>2022-05-03 18:56:13 +0200
commitab387593b9a9f5b23df55c12679118dddc8e181a (patch)
tree88876f9aee03e17b5ea909135a99f43ba6e8ef56 /toolkit/source/controls/tabpagecontainer.cxx
parent8ad4fdb1687e705e31d9a4f30b385d50b91def08 (diff)
Use o3tl::make_unsigned in some places
...where a signed and an unsigned value are compared, and the signed value has just been proven to be non-negative here Change-Id: I1a9832b5b8b5304fa011a3ed57996a8e3751388b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133760 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'toolkit/source/controls/tabpagecontainer.cxx')
-rw-r--r--toolkit/source/controls/tabpagecontainer.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/toolkit/source/controls/tabpagecontainer.cxx b/toolkit/source/controls/tabpagecontainer.cxx
index b0f437139ea3..d4028b2901f1 100644
--- a/toolkit/source/controls/tabpagecontainer.cxx
+++ b/toolkit/source/controls/tabpagecontainer.cxx
@@ -27,6 +27,7 @@
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
+#include <o3tl/safeint.hxx>
#include <tools/diagnose_ex.h>
#include <vcl/svapp.hxx>
@@ -176,7 +177,7 @@ void SAL_CALL UnoControlTabPageContainerModel::replaceByIndex( ::sal_Int32 /*Ind
uno::Any SAL_CALL UnoControlTabPageContainerModel::getByIndex( ::sal_Int32 nIndex )
{
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- if ( nIndex < 0 || nIndex > sal_Int32(m_aTabPageVector.size()) )
+ if ( nIndex < 0 || o3tl::make_unsigned(nIndex) > m_aTabPageVector.size() )
throw lang::IndexOutOfBoundsException();
return uno::Any(m_aTabPageVector[nIndex]);
}