summaryrefslogtreecommitdiff
path: root/sd/source/ui/unoidl/unocpres.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/ui/unoidl/unocpres.cxx')
-rw-r--r--sd/source/ui/unoidl/unocpres.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sd/source/ui/unoidl/unocpres.cxx b/sd/source/ui/unoidl/unocpres.cxx
index e5c9eb16e021..cc57b1e7941a 100644
--- a/sd/source/ui/unoidl/unocpres.cxx
+++ b/sd/source/ui/unoidl/unocpres.cxx
@@ -21,6 +21,7 @@
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+#include <o3tl/safeint.hxx>
#include <vcl/svapp.hxx>
#include <svx/svdpage.hxx>
#include <cppuhelper/supportsservice.hxx>
@@ -84,7 +85,7 @@ void SAL_CALL SdXCustomPresentation::insertByIndex( sal_Int32 Index, const uno::
if( bDisposing )
throw lang::DisposedException();
- if( Index < 0 || Index > static_cast<sal_Int32>( mpSdCustomShow ? mpSdCustomShow->PagesVector().size() : 0 ) )
+ if( Index < 0 || o3tl::make_unsigned(Index) > ( mpSdCustomShow ? mpSdCustomShow->PagesVector().size() : 0 ) )
throw lang::IndexOutOfBoundsException();
uno::Reference< drawing::XDrawPage > xPage;
@@ -182,7 +183,7 @@ uno::Any SAL_CALL SdXCustomPresentation::getByIndex( sal_Int32 Index )
if( bDisposing )
throw lang::DisposedException();
- if (Index < 0 || !mpSdCustomShow || Index >= static_cast<sal_Int32>(mpSdCustomShow->PagesVector().size()))
+ if (Index < 0 || !mpSdCustomShow || o3tl::make_unsigned(Index) >= mpSdCustomShow->PagesVector().size())
throw lang::IndexOutOfBoundsException();
uno::Any aAny;