accessibility : remove useless guards and optimisze a litle
Change-Id: I1162f364d948b73b943fb973222103772fffddc3 Reviewed-on: https://gerrit.libreoffice.org/53629 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
committed by
Noel Grandin
parent
5b77e676f5
commit
9f3e8cb4af
@@ -839,14 +839,20 @@ sal_Int32 VCLXAccessibleToolBox::getSelectedAccessibleChildCount( )
|
|||||||
OExternalLockGuard aGuard( this );
|
OExternalLockGuard aGuard( this );
|
||||||
|
|
||||||
sal_Int32 nRet = 0;
|
sal_Int32 nRet = 0;
|
||||||
for ( sal_Int32 i = 0, nCount = implGetAccessibleChildCount(); i < nCount; i++ )
|
VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
|
||||||
|
if (pToolBox)
|
||||||
{
|
{
|
||||||
if ( isAccessibleChildSelected( i ) )
|
sal_uInt16 nHighlightItemId = pToolBox->GetHighlightItemId();
|
||||||
|
for ( size_t i = 0, nCount = pToolBox->GetItemCount(); i < nCount; i++ )
|
||||||
{
|
{
|
||||||
nRet = 1;
|
if ( nHighlightItemId == pToolBox->GetItemId( i ) )
|
||||||
break; // a toolbox can only have (n)one selected child
|
{
|
||||||
|
nRet = 1;
|
||||||
|
break; // a toolbox can only have (n)one selected child
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nRet;
|
return nRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -857,14 +863,20 @@ Reference< XAccessible > VCLXAccessibleToolBox::getSelectedAccessibleChild( sal_
|
|||||||
throw IndexOutOfBoundsException();
|
throw IndexOutOfBoundsException();
|
||||||
|
|
||||||
Reference< XAccessible > xChild;
|
Reference< XAccessible > xChild;
|
||||||
for ( sal_Int32 i = 0, nCount = implGetAccessibleChildCount(); i < nCount; i++ )
|
VclPtr< ToolBox > pToolBox = GetAs< ToolBox >();
|
||||||
|
if (pToolBox)
|
||||||
{
|
{
|
||||||
if ( isAccessibleChildSelected( i ) )
|
sal_uInt16 nHighlightItemId = pToolBox->GetHighlightItemId();
|
||||||
|
for ( sal_Int32 i = 0, nCount = pToolBox->GetItemCount(); i < nCount; i++ )
|
||||||
{
|
{
|
||||||
xChild = getAccessibleChild( i );
|
if ( nHighlightItemId == pToolBox->GetItemId( i ) )
|
||||||
break;
|
{
|
||||||
|
xChild = getAccessibleChild( i );
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!xChild)
|
if (!xChild)
|
||||||
throw IndexOutOfBoundsException();
|
throw IndexOutOfBoundsException();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user