editeng a11y: Pass bullet's child index in ctor

... instead of having a separate getter,
AccessibleImageBullet::SetIndexInParent.

Change-Id: Ie0e59f87e12d04efd72aa5663c4a3eb0df9baf21
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183829
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
Michael Weghorn
2025-04-07 11:55:49 +02:00
parent bafaf554a0
commit a2baa12f90
3 changed files with 6 additions and 19 deletions

View File

@@ -584,11 +584,10 @@ uno::Reference< XAccessible > SAL_CALL AccessibleEditableTextPara::getAccessible
if( !aChild.is() )
{
// there is no hard reference available, create object then
aChild = new AccessibleImageBullet(this);
aChild = new AccessibleImageBullet(this, i);
aChild->SetEditSource( &GetEditSource() );
aChild->SetParagraphIndex( GetParagraphIndex() );
aChild->SetIndexInParent( i );
maImageBullet = aChild.get();
}

View File

@@ -49,9 +49,10 @@ using namespace ::com::sun::star::accessibility;
namespace accessibility
{
AccessibleImageBullet::AccessibleImageBullet ( uno::Reference< XAccessible > xParent ) :
AccessibleImageBullet::AccessibleImageBullet(uno::Reference<XAccessible> xParent,
sal_Int64 nIndexInParent) :
mnParagraphIndex( 0 ),
mnIndexInParent( 0 ),
mnIndexInParent(nIndexInParent),
mpEditSource( nullptr ),
maEEOffset( 0, 0 ),
mxParent(std::move( xParent ))
@@ -216,11 +217,6 @@ uno::Sequence< OUString > SAL_CALL AccessibleImageBullet::getSupportedServiceNam
return { u"com.sun.star.accessibility.AccessibleContext"_ustr };
}
void AccessibleImageBullet::SetIndexInParent( sal_Int32 nIndex )
{
mnIndexInParent = nIndex;
}
void AccessibleImageBullet::SetEEOffset( const Point& rOffset )
{
maEEOffset = rOffset;

View File

@@ -44,7 +44,8 @@ class AccessibleImageBullet final
public:
/// Create accessible object for given parent
AccessibleImageBullet ( css::uno::Reference< css::accessibility::XAccessible > xParent );
AccessibleImageBullet(css::uno::Reference<css::accessibility::XAccessible> xParent,
sal_Int64 nIndexInParent);
// XAccessible
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) override;
@@ -72,15 +73,6 @@ public:
virtual sal_Bool SAL_CALL supportsService (const OUString& sServiceName) override;
virtual css::uno::Sequence< OUString> SAL_CALL getSupportedServiceNames() override;
/** Set the current index in the accessibility parent
@attention This method does not lock the SolarMutex,
leaving that to the calling code. This is because only
there potential deadlock situations can be resolved. Thus,
make sure SolarMutex is locked when calling this.
*/
void SetIndexInParent( sal_Int32 nIndex );
/** Set the edit engine offset
@attention This method does not lock the SolarMutex,