summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-04-26 15:08:36 +0200
committerStephan Bergmann <sbergman@redhat.com>2022-04-26 17:04:01 +0200
commitbdff0bb77b57def835fcaed3bded7519e69dc896 (patch)
treec330add464f566a32ebd82dd9ad29f91ba0d87f8 /unotools
parent651527b4efe9700c8c8dff58ce5aa86ad5681f16 (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: I9665e6c2c4c5557f2d4cf1bb646f9fffc7bd7d30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133442 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/i18n/localedatawrapper.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx
index fa30ceb9b5a1..9c4c5badabe3 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -27,6 +27,7 @@
#include <tools/diagnose_ex.h>
#include <tools/debug.hxx>
#include <i18nlangtag/languagetag.hxx>
+#include <o3tl/safeint.hxx>
#include <com/sun/star/i18n/KNumberFormatUsage.hpp>
#include <com/sun/star/i18n/KNumberFormatType.hpp>
@@ -376,7 +377,7 @@ const OUString& LocaleDataWrapper::getOneLocaleItem( sal_Int16 nItem ) const
const OUString& LocaleDataWrapper::getOneReservedWord( sal_Int16 nWord ) const
{
- if ( nWord < 0 || nWord >= static_cast<sal_Int16>(aReservedWords.size()) )
+ if ( nWord < 0 || o3tl::make_unsigned(nWord) >= aReservedWords.size() )
{
SAL_WARN( "unotools.i18n", "getOneReservedWord: bounds" );
static const OUString EMPTY;