diff options
Diffstat (limited to 'reportdesign/source/core/api')
-rw-r--r-- | reportdesign/source/core/api/Functions.cxx | 3 | ||||
-rw-r--r-- | reportdesign/source/core/api/Groups.cxx | 3 | ||||
-rw-r--r-- | reportdesign/source/core/api/ReportControlModel.cxx | 3 | ||||
-rw-r--r-- | reportdesign/source/core/api/ReportDefinition.cxx | 3 |
4 files changed, 8 insertions, 4 deletions
diff --git a/reportdesign/source/core/api/Functions.cxx b/reportdesign/source/core/api/Functions.cxx index 31928d8b34ec..820d3c0eaba3 100644 --- a/reportdesign/source/core/api/Functions.cxx +++ b/reportdesign/source/core/api/Functions.cxx @@ -22,6 +22,7 @@ #include <strings.hrc> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> #include <com/sun/star/lang/NoSupportException.hpp> +#include <o3tl/safeint.hxx> namespace reportdesign { @@ -182,7 +183,7 @@ void SAL_CALL OFunctions::removeContainerListener( const uno::Reference< contain void OFunctions::checkIndex(sal_Int32 _nIndex) { - if ( _nIndex < 0 || static_cast<sal_Int32>(m_aFunctions.size()) <= _nIndex ) + if ( _nIndex < 0 || m_aFunctions.size() <= o3tl::make_unsigned(_nIndex) ) throw lang::IndexOutOfBoundsException(); } diff --git a/reportdesign/source/core/api/Groups.cxx b/reportdesign/source/core/api/Groups.cxx index 6310813134a9..780c6093bec4 100644 --- a/reportdesign/source/core/api/Groups.cxx +++ b/reportdesign/source/core/api/Groups.cxx @@ -20,6 +20,7 @@ #include <Group.hxx> #include <com/sun/star/lang/NoSupportException.hpp> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> +#include <o3tl/safeint.hxx> #include <core_resource.hxx> #include <strings.hrc> @@ -184,7 +185,7 @@ void SAL_CALL OGroups::removeContainerListener( const uno::Reference< container: void OGroups::checkIndex(sal_Int32 _nIndex) { - if ( _nIndex < 0 || static_cast<sal_Int32>(m_aGroups.size()) <= _nIndex ) + if ( _nIndex < 0 || m_aGroups.size() <= o3tl::make_unsigned(_nIndex) ) throw lang::IndexOutOfBoundsException(); } diff --git a/reportdesign/source/core/api/ReportControlModel.cxx b/reportdesign/source/core/api/ReportControlModel.cxx index f1a00af093a0..16dee9bd17bc 100644 --- a/reportdesign/source/core/api/ReportControlModel.cxx +++ b/reportdesign/source/core/api/ReportControlModel.cxx @@ -20,6 +20,7 @@ #include <com/sun/star/beans/XMultiPropertySet.hpp> #include <com/sun/star/beans/XPropertyState.hpp> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> +#include <o3tl/safeint.hxx> namespace reportdesign { using namespace com::sun::star; @@ -118,7 +119,7 @@ uno::Any OReportControlModel::getByIndex(::sal_Int32 Index) void OReportControlModel::checkIndex(sal_Int32 _nIndex) { - if (_nIndex < 0 || static_cast<sal_Int32>(m_aFormatConditions.size()) <= _nIndex) + if (_nIndex < 0 || m_aFormatConditions.size() <= o3tl::make_unsigned(_nIndex)) throw lang::IndexOutOfBoundsException(); } diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index d6d5e8179d66..4ff066ba86cb 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -102,6 +102,7 @@ #include <dbaccess/dbaundomanager.hxx> #include <editeng/paperinf.hxx> #include <framework/titlehelper.hxx> +#include <o3tl/safeint.hxx> #include <svl/itempool.hxx> #include <svl/undo.hxx> #include <svx/svdlayer.hxx> @@ -2282,7 +2283,7 @@ sal_Int32 SAL_CALL OStylesHelper::getCount( ) uno::Any SAL_CALL OStylesHelper::getByIndex( sal_Int32 Index ) { ::osl::MutexGuard aGuard(m_aMutex); - if ( Index < 0 || Index >= static_cast<sal_Int32>(m_aElementsPos.size()) ) + if ( Index < 0 || o3tl::make_unsigned(Index) >= m_aElementsPos.size() ) throw lang::IndexOutOfBoundsException(); return m_aElementsPos[Index]->second; } |