diff options
Diffstat (limited to 'sdext')
-rw-r--r-- | sdext/source/pdfimport/tree/imagecontainer.cxx | 3 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterAccessibility.cxx | 4 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterTextView.cxx | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/sdext/source/pdfimport/tree/imagecontainer.cxx b/sdext/source/pdfimport/tree/imagecontainer.cxx index 9754e9134a50..a7154164d771 100644 --- a/sdext/source/pdfimport/tree/imagecontainer.cxx +++ b/sdext/source/pdfimport/tree/imagecontainer.cxx @@ -24,6 +24,7 @@ #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> +#include <o3tl/safeint.hxx> #include <osl/diagnose.h> #include <com/sun/star/beans/PropertyValue.hpp> @@ -111,7 +112,7 @@ ImageId ImageContainer::addImage( const uno::Sequence<beans::PropertyValue>& xBi void ImageContainer::writeBase64EncodedStream( ImageId nId, EmitContext& rContext ) { - OSL_ASSERT( nId >= 0 && nId < ImageId( m_aImages.size()) ); + OSL_ASSERT( nId >= 0 && o3tl::make_unsigned(nId) < m_aImages.size() ); const uno::Sequence<beans::PropertyValue>& rEntry( m_aImages[nId] ); diff --git a/sdext/source/presenter/PresenterAccessibility.cxx b/sdext/source/presenter/PresenterAccessibility.cxx index 10d73b88d898..e3f49ed1dddf 100644 --- a/sdext/source/presenter/PresenterAccessibility.cxx +++ b/sdext/source/presenter/PresenterAccessibility.cxx @@ -792,7 +792,7 @@ Reference<XAccessible> SAL_CALL { ThrowIfDisposed(); - if (nIndex<0 || nIndex>=sal_Int32(maChildren.size())) + if (nIndex<0 || o3tl::make_unsigned(nIndex)>=maChildren.size()) throw lang::IndexOutOfBoundsException("invalid child index", static_cast<uno::XWeak*>(this)); return maChildren[nIndex]; @@ -1229,7 +1229,7 @@ AccessibleStateSet::AccessibleStateSet (const sal_Int32 nStateSet) sal_uInt32 AccessibleStateSet::GetStateMask (const sal_Int16 nState) { - if (nState<0 || nState>=sal_Int16(sizeof(sal_uInt32)*8)) + if (nState<0 || o3tl::make_unsigned(nState)>=sizeof(sal_uInt32)*8) { throw RuntimeException("AccessibleStateSet::GetStateMask: invalid state"); } diff --git a/sdext/source/presenter/PresenterTextView.cxx b/sdext/source/presenter/PresenterTextView.cxx index f77ef93bc6d8..d83229b88e2a 100644 --- a/sdext/source/presenter/PresenterTextView.cxx +++ b/sdext/source/presenter/PresenterTextView.cxx @@ -419,7 +419,7 @@ SharedPresenterTextParagraph PresenterTextView::GetParagraph ( { if (nParagraphIndex < 0) return SharedPresenterTextParagraph(); - else if (nParagraphIndex>=sal_Int32(maParagraphs.size())) + else if (o3tl::make_unsigned(nParagraphIndex)>=maParagraphs.size()) return SharedPresenterTextParagraph(); else return maParagraphs[nParagraphIndex]; |