Kaydet (Commit) 88179e3d authored tarafından Markus Mohrhard's avatar Markus Mohrhard

Revert "accessibility: remove useless calls to getAccessibleActionCount."

This reverts commit e2c14a6c.

Change-Id: I6dc99c8ad9c6f15d6b1273338d96bc7909253ad9
Reviewed-on: https://gerrit.libreoffice.org/40815Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst 00a87bab
......@@ -92,7 +92,7 @@ public:
virtual sal_Bool SAL_CALL copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) override;
// XAccessibleAction
virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) final override;
virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) override;
virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) override;
virtual OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) override;
virtual css::uno::Reference< css::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) override;
......
......@@ -187,7 +187,7 @@ sal_Bool VCLXAccessibleButton::doAccessibleAction ( sal_Int32 nIndex )
{
OExternalLockGuard aGuard( this );
if ( nIndex != 0 )
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
VclPtr< PushButton > pButton = GetAs< PushButton >();
......@@ -202,7 +202,7 @@ OUString VCLXAccessibleButton::getAccessibleActionDescription ( sal_Int32 nIndex
{
OExternalLockGuard aGuard( this );
if ( nIndex != 0 )
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
return OUString(RID_STR_ACC_ACTION_CLICK);
......@@ -213,7 +213,7 @@ Reference< XAccessibleKeyBinding > VCLXAccessibleButton::getAccessibleActionKeyB
{
OExternalLockGuard aGuard( this );
if ( nIndex != 0 )
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
OAccessibleKeyBindingHelper* pKeyBindingHelper = new OAccessibleKeyBindingHelper();
......
......@@ -184,7 +184,7 @@ sal_Bool VCLXAccessibleCheckBox::doAccessibleAction ( sal_Int32 nIndex )
{
OExternalLockGuard aGuard( this );
if ( nIndex != 0 )
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
VclPtr< CheckBox > pCheckBox = GetAs< CheckBox >();
......@@ -214,7 +214,7 @@ OUString VCLXAccessibleCheckBox::getAccessibleActionDescription ( sal_Int32 nInd
{
OExternalLockGuard aGuard( this );
if ( nIndex != 0 )
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
if(IsChecked())
......@@ -228,7 +228,7 @@ Reference< XAccessibleKeyBinding > VCLXAccessibleCheckBox::getAccessibleActionKe
{
OExternalLockGuard aGuard( this );
if ( nIndex != 0 )
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
OAccessibleKeyBindingHelper* pKeyBindingHelper = new OAccessibleKeyBindingHelper();
......
......@@ -231,7 +231,7 @@ OUString VCLXAccessibleMenu::getAccessibleActionDescription ( sal_Int32 nIndex )
{
OExternalLockGuard aGuard( this );
if ( nIndex < 0 || nIndex >= GetChildCount() )
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
return OUString( );
......
......@@ -405,7 +405,7 @@ sal_Bool VCLXAccessibleMenuItem::doAccessibleAction ( sal_Int32 nIndex )
{
OExternalLockGuard aGuard( this );
if ( nIndex != 0 )
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
Click();
......@@ -418,7 +418,7 @@ OUString VCLXAccessibleMenuItem::getAccessibleActionDescription ( sal_Int32 nInd
{
OExternalLockGuard aGuard( this );
if ( nIndex != 0 )
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
return OUString(RID_STR_ACC_ACTION_SELECT);
......@@ -429,7 +429,7 @@ Reference< XAccessibleKeyBinding > VCLXAccessibleMenuItem::getAccessibleActionKe
{
OExternalLockGuard aGuard( this );
if ( nIndex != 0 )
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
OAccessibleKeyBindingHelper* pKeyBindingHelper = new OAccessibleKeyBindingHelper();
......
......@@ -162,7 +162,7 @@ sal_Bool VCLXAccessibleRadioButton::doAccessibleAction ( sal_Int32 nIndex )
{
OExternalLockGuard aGuard( this );
if ( nIndex != 0 )
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
VCLXRadioButton* pVCLXRadioButton = static_cast< VCLXRadioButton* >( GetVCLXWindow() );
......@@ -176,7 +176,7 @@ OUString VCLXAccessibleRadioButton::getAccessibleActionDescription ( sal_Int32 n
{
OExternalLockGuard aGuard( this );
if ( nIndex != 0 )
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
return OUString(RID_STR_ACC_ACTION_SELECT);
......@@ -186,7 +186,7 @@ Reference< XAccessibleKeyBinding > VCLXAccessibleRadioButton::getAccessibleActio
{
OExternalLockGuard aGuard( this );
if ( nIndex != 0 )
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
OAccessibleKeyBindingHelper* pKeyBindingHelper = new OAccessibleKeyBindingHelper();
......
......@@ -117,13 +117,12 @@ Sequence< OUString > VCLXAccessibleScrollBar::getSupportedServiceNames()
// XAccessibleAction
static constexpr sal_Int32 ACCESSIBLE_ACTION_COUNT=4;
sal_Int32 VCLXAccessibleScrollBar::getAccessibleActionCount( )
{
OExternalLockGuard aGuard( this );
return ACCESSIBLE_ACTION_COUNT;
return 4;
}
......@@ -131,7 +130,7 @@ sal_Bool VCLXAccessibleScrollBar::doAccessibleAction ( sal_Int32 nIndex )
{
OExternalLockGuard aGuard( this );
if ( nIndex < 0 || nIndex >= ACCESSIBLE_ACTION_COUNT )
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
bool bReturn = false;
......@@ -159,7 +158,7 @@ OUString VCLXAccessibleScrollBar::getAccessibleActionDescription ( sal_Int32 nIn
{
OExternalLockGuard aGuard( this );
if ( nIndex < 0 || nIndex >= ACCESSIBLE_ACTION_COUNT )
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
OUString sDescription;
......@@ -181,7 +180,7 @@ Reference< XAccessibleKeyBinding > VCLXAccessibleScrollBar::getAccessibleActionK
{
OExternalLockGuard aGuard( this );
if ( nIndex < 0 || nIndex >= ACCESSIBLE_ACTION_COUNT )
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
return Reference< XAccessibleKeyBinding >();
......
......@@ -621,7 +621,7 @@ sal_Bool VCLXAccessibleToolBoxItem::doAccessibleAction ( sal_Int32 nIndex )
{
OExternalLockGuard aGuard( this );
if ( nIndex != 0 )
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
if ( m_pToolBox )
......@@ -634,7 +634,7 @@ OUString VCLXAccessibleToolBoxItem::getAccessibleActionDescription ( sal_Int32 n
{
OExternalLockGuard aGuard( this );
if ( nIndex != 0 )
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
return OUString(RID_STR_ACC_ACTION_CLICK);
......@@ -644,7 +644,7 @@ Reference< XAccessibleKeyBinding > VCLXAccessibleToolBoxItem::getAccessibleActio
{
OContextEntryGuard aGuard( this );
if ( nIndex != 0 )
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
return Reference< XAccessibleKeyBinding >();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment