Kaydet (Commit) b3098d23 authored tarafından Caolán McNamara's avatar Caolán McNamara

Related: tdf#105712 inconsistency with num of a11y children in special char

with no visible scrollbar it claims 1 child, but trying to get child at
index 0 throws

Change-Id: Icf1a0afc4a6f6090e3f14f30b4380db477955561
üst deff2acd
...@@ -71,11 +71,16 @@ void SAL_CALL SvxShowCharSetVirtualAcc::fireEvent( ...@@ -71,11 +71,16 @@ void SAL_CALL SvxShowCharSetVirtualAcc::fireEvent(
m_xTable->fireEvent(_nEventId,_rOldValue,_rNewValue); m_xTable->fireEvent(_nEventId,_rOldValue,_rNewValue);
} }
sal_Int32 SAL_CALL SvxShowCharSetVirtualAcc::getAccessibleChildCount( ) sal_Int32 SvxShowCharSetVirtualAcc::getImplAccessibleChildCount() const
{
return mpParent->getScrollBar().IsVisible() ? 2 : 1;
}
sal_Int32 SAL_CALL SvxShowCharSetVirtualAcc::getAccessibleChildCount()
{ {
OExternalLockGuard aGuard( this ); OExternalLockGuard aGuard( this );
ensureAlive(); ensureAlive();
return ( mpParent->getScrollBar().IsVisible() ) ? 2 : 1; return getImplAccessibleChildCount();
} }
uno::Reference< css::accessibility::XAccessible > SAL_CALL SvxShowCharSetVirtualAcc::getAccessibleAtPoint( const awt::Point& aPoint ) uno::Reference< css::accessibility::XAccessible > SAL_CALL SvxShowCharSetVirtualAcc::getAccessibleAtPoint( const awt::Point& aPoint )
...@@ -115,17 +120,17 @@ Reference< XAccessible > SAL_CALL SvxShowCharSetVirtualAcc::getAccessibleChild( ...@@ -115,17 +120,17 @@ Reference< XAccessible > SAL_CALL SvxShowCharSetVirtualAcc::getAccessibleChild(
{ {
OExternalLockGuard aGuard( this ); OExternalLockGuard aGuard( this );
ensureAlive(); ensureAlive();
if ( mpParent->getScrollBar().IsVisible() && i == 0 )
return mpParent->getScrollBar().GetAccessible(); sal_Int32 nCount = getImplAccessibleChildCount();
else if ( i == 1 ) if (i >= nCount)
{
if ( !m_xTable.is() )
{
m_xTable = new SvxShowCharSetAcc(this);
}
}
else
throw IndexOutOfBoundsException(); throw IndexOutOfBoundsException();
if (i == 0 && mpParent->getScrollBar().IsVisible())
return mpParent->getScrollBar().GetAccessible();
if (!m_xTable.is())
m_xTable = new SvxShowCharSetAcc(this);
return m_xTable.get(); return m_xTable.get();
} }
......
...@@ -43,6 +43,7 @@ namespace svx ...@@ -43,6 +43,7 @@ namespace svx
{ {
VclPtr<SvxShowCharSet> mpParent; // the vcl control VclPtr<SvxShowCharSet> mpParent; // the vcl control
rtl::Reference<SvxShowCharSetAcc> m_xTable; // the table, which holds the characters shown by the vcl control rtl::Reference<SvxShowCharSetAcc> m_xTable; // the table, which holds the characters shown by the vcl control
sal_Int32 getImplAccessibleChildCount() const;
protected: protected:
virtual ~SvxShowCharSetVirtualAcc() override; virtual ~SvxShowCharSetVirtualAcc() override;
......
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