diff options
Diffstat (limited to 'sw/source/core/unocore/unoobj2.cxx')
-rw-r--r-- | sw/source/core/unocore/unoobj2.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index a4708d249970..417370f05980 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -21,6 +21,7 @@ #include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> +#include <o3tl/safeint.hxx> #include <svl/listener.hxx> #include <svx/svdobj.hxx> #include <vcl/svapp.hxx> @@ -1487,7 +1488,7 @@ sal_Int32 SAL_CALL SwXTextRangesImpl::getCount() uno::Any SAL_CALL SwXTextRangesImpl::getByIndex(sal_Int32 nIndex) { SolarMutexGuard aGuard; - if ((nIndex < 0) || (static_cast<size_t>(nIndex) >= m_Ranges.size())) + if ((nIndex < 0) || (o3tl::make_unsigned(nIndex) >= m_Ranges.size())) throw lang::IndexOutOfBoundsException(); uno::Any ret; ret <<= m_Ranges.at(nIndex); |