summaryrefslogtreecommitdiff
path: root/accessibility
diff options
context:
space:
mode:
Diffstat (limited to 'accessibility')
-rw-r--r--accessibility/source/standard/vclxaccessiblelist.cxx2
-rw-r--r--accessibility/source/standard/vclxaccessibletabcontrol.cxx9
-rw-r--r--accessibility/source/standard/vclxaccessibletoolbox.cxx7
3 files changed, 10 insertions, 8 deletions
diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx b/accessibility/source/standard/vclxaccessiblelist.cxx
index b549c6d0c008..de2dfc399311 100644
--- a/accessibility/source/standard/vclxaccessiblelist.cxx
+++ b/accessibility/source/standard/vclxaccessiblelist.cxx
@@ -457,7 +457,7 @@ Reference<XAccessible> VCLXAccessibleList::CreateChild (sal_Int32 nPos)
{
Reference<XAccessible> xChild;
- if ( static_cast<size_t>(nPos) >= m_aAccessibleChildren.size() )
+ if ( o3tl::make_unsigned(nPos) >= m_aAccessibleChildren.size() )
{
m_aAccessibleChildren.resize(nPos + 1);
diff --git a/accessibility/source/standard/vclxaccessibletabcontrol.cxx b/accessibility/source/standard/vclxaccessibletabcontrol.cxx
index c88d8d427321..d65e74b242e3 100644
--- a/accessibility/source/standard/vclxaccessibletabcontrol.cxx
+++ b/accessibility/source/standard/vclxaccessibletabcontrol.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
+#include <o3tl/safeint.hxx>
#include <unotools/accessiblestatesethelper.hxx>
#include <vcl/tabctrl.hxx>
#include <vcl/tabpage.hxx>
@@ -354,7 +355,7 @@ Reference< XAccessible > VCLXAccessibleTabControl::getAccessibleChild( sal_Int32
{
OExternalLockGuard aGuard( this );
- if ( i < 0 || static_cast<std::size_t>(i) >= m_aAccessibleChildren.size() )
+ if ( i < 0 || o3tl::make_unsigned(i) >= m_aAccessibleChildren.size() )
throw IndexOutOfBoundsException();
return implGetAccessibleChild( i );
@@ -402,7 +403,7 @@ void VCLXAccessibleTabControl::selectAccessibleChild( sal_Int32 nChildIndex )
{
OExternalLockGuard aGuard( this );
- if ( nChildIndex < 0 || static_cast<std::size_t>(nChildIndex) >= m_aAccessibleChildren.size() )
+ if ( nChildIndex < 0 || o3tl::make_unsigned(nChildIndex) >= m_aAccessibleChildren.size() )
throw IndexOutOfBoundsException();
if ( m_pTabControl )
@@ -414,7 +415,7 @@ sal_Bool VCLXAccessibleTabControl::isAccessibleChildSelected( sal_Int32 nChildIn
{
OExternalLockGuard aGuard( this );
- if ( nChildIndex < 0 || static_cast<std::size_t>(nChildIndex) >= m_aAccessibleChildren.size() )
+ if ( nChildIndex < 0 || o3tl::make_unsigned(nChildIndex) >= m_aAccessibleChildren.size() )
throw IndexOutOfBoundsException();
return implIsAccessibleChildSelected( nChildIndex );
@@ -476,7 +477,7 @@ void VCLXAccessibleTabControl::deselectAccessibleChild( sal_Int32 nChildIndex )
{
OExternalLockGuard aGuard( this );
- if ( nChildIndex < 0 || static_cast<std::size_t>(nChildIndex) >= m_aAccessibleChildren.size() )
+ if ( nChildIndex < 0 || o3tl::make_unsigned(nChildIndex) >= m_aAccessibleChildren.size() )
throw IndexOutOfBoundsException();
// This method makes no sense in a tab control, and so does nothing.
diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx b/accessibility/source/standard/vclxaccessibletoolbox.cxx
index c456b93997b4..762b2a58ba39 100644
--- a/accessibility/source/standard/vclxaccessibletoolbox.cxx
+++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx
@@ -27,6 +27,7 @@
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <o3tl/safeint.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/vclevent.hxx>
#include <comphelper/accessiblewrapper.hxx>
@@ -689,7 +690,7 @@ Reference< XAccessible > SAL_CALL VCLXAccessibleToolBox::getAccessibleChild( sal
comphelper::OExternalLockGuard aGuard( this );
VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
- if ( (!pToolBox) || i < 0 || static_cast<size_t>(i) >= pToolBox->GetItemCount() )
+ if ( (!pToolBox) || i < 0 || o3tl::make_unsigned(i) >= pToolBox->GetItemCount() )
throw IndexOutOfBoundsException();
Reference< XAccessible > xChild;
@@ -778,7 +779,7 @@ void VCLXAccessibleToolBox::selectAccessibleChild( sal_Int32 nChildIndex )
OExternalLockGuard aGuard( this );
VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
- if ( (!pToolBox) || nChildIndex < 0 || static_cast<size_t> (nChildIndex) >= pToolBox->GetItemCount() )
+ if ( (!pToolBox) || nChildIndex < 0 || o3tl::make_unsigned(nChildIndex) >= pToolBox->GetItemCount() )
throw IndexOutOfBoundsException();
pToolBox->ChangeHighlight( nChildIndex );
@@ -788,7 +789,7 @@ sal_Bool VCLXAccessibleToolBox::isAccessibleChildSelected( sal_Int32 nChildIndex
{
OExternalLockGuard aGuard( this );
VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
- if ( (!pToolBox) || nChildIndex < 0 || static_cast<size_t>(nChildIndex) >= pToolBox->GetItemCount() )
+ if ( (!pToolBox) || nChildIndex < 0 || o3tl::make_unsigned(nChildIndex) >= pToolBox->GetItemCount() )
throw IndexOutOfBoundsException();
if ( pToolBox->GetHighlightItemId() == pToolBox->GetItemId( nChildIndex ) )