summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/accessibility/accessiblerelationsethelper.cxx3
-rw-r--r--unotools/source/streaming/streamhelper.cxx3
-rw-r--r--unotools/source/streaming/streamwrap.cxx3
-rw-r--r--unotools/source/ucbhelper/xtempfile.cxx3
4 files changed, 8 insertions, 4 deletions
diff --git a/unotools/source/accessibility/accessiblerelationsethelper.cxx b/unotools/source/accessibility/accessiblerelationsethelper.cxx
index 0e2a57773bb1..8f70623435dc 100644
--- a/unotools/source/accessibility/accessiblerelationsethelper.cxx
+++ b/unotools/source/accessibility/accessiblerelationsethelper.cxx
@@ -20,6 +20,7 @@
#include <sal/config.h>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+#include <o3tl/safeint.hxx>
#include <unotools/accessiblerelationsethelper.hxx>
#include <vector>
#include <comphelper/sequence.hxx>
@@ -66,7 +67,7 @@ sal_Int32 AccessibleRelationSetHelperImpl::getRelationCount() const
AccessibleRelation const & AccessibleRelationSetHelperImpl::getRelation( sal_Int32 nIndex ) const
{
- if ((nIndex < 0) || (static_cast<sal_uInt32>(nIndex) >= maRelations.size()))
+ if ((nIndex < 0) || (o3tl::make_unsigned(nIndex) >= maRelations.size()))
throw lang::IndexOutOfBoundsException();
return maRelations[nIndex];
}
diff --git a/unotools/source/streaming/streamhelper.cxx b/unotools/source/streaming/streamhelper.cxx
index 1b639fb04825..cf5930d43f19 100644
--- a/unotools/source/streaming/streamhelper.cxx
+++ b/unotools/source/streaming/streamhelper.cxx
@@ -22,6 +22,7 @@
#include <com/sun/star/io/BufferSizeExceededException.hpp>
#include <com/sun/star/io/IOException.hpp>
#include <com/sun/star/io/NotConnectedException.hpp>
+#include <o3tl/safeint.hxx>
#include <unotools/streamhelper.hxx>
namespace utl
@@ -47,7 +48,7 @@ sal_Int32 SAL_CALL OInputStreamHelper::readBytes(css::uno::Sequence< sal_Int8 >&
throw css::io::IOException(OUString(), static_cast<css::uno::XWeak*>(this));
// adjust sequence if data read is lower than the desired data
- if (nRead < static_cast<std::size_t>(aData.getLength()))
+ if (nRead < o3tl::make_unsigned(aData.getLength()))
aData.realloc( nRead );
return nRead;
diff --git a/unotools/source/streaming/streamwrap.cxx b/unotools/source/streaming/streamwrap.cxx
index c24fa09015c1..b2d842f81ff5 100644
--- a/unotools/source/streaming/streamwrap.cxx
+++ b/unotools/source/streaming/streamwrap.cxx
@@ -21,6 +21,7 @@
#include <com/sun/star/io/BufferSizeExceededException.hpp>
#include <com/sun/star/io/NotConnectedException.hpp>
+#include <o3tl/safeint.hxx>
#include <unotools/streamwrap.hxx>
#include <tools/stream.hxx>
@@ -71,7 +72,7 @@ sal_Int32 SAL_CALL OInputStreamWrapper::readBytes(css::uno::Sequence< sal_Int8 >
checkError();
// If read characters < MaxLength, adjust css::uno::Sequence
- if (nRead < static_cast<std::size_t>(aData.getLength()))
+ if (nRead < o3tl::make_unsigned(aData.getLength()))
aData.realloc( nRead );
return nRead;
diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx
index 24213db368a8..0bd03b6b052f 100644
--- a/unotools/source/ucbhelper/xtempfile.cxx
+++ b/unotools/source/ucbhelper/xtempfile.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <cppuhelper/typeprovider.hxx>
#include <comphelper/servicedecl.hxx>
+#include <o3tl/safeint.hxx>
#include <unotools/tempfile.hxx>
#include <cppuhelper/propshlp.hxx>
@@ -124,7 +125,7 @@ sal_Int32 SAL_CALL OTempFileService::readBytes( css::uno::Sequence< sal_Int8 >&
sal_uInt32 nRead = mpStream->ReadBytes(static_cast<void*>(aData.getArray()), nBytesToRead);
checkError();
- if (nRead < static_cast<std::size_t>(aData.getLength()))
+ if (nRead < o3tl::make_unsigned(aData.getLength()))
aData.realloc( nRead );
if ( sal::static_int_cast<sal_uInt32>(nBytesToRead) > nRead )