editeng/source/accessibility/AccessibleContextBase.cxx |    7 ---
 include/editeng/AccessibleContextBase.hxx              |    2 -
 sc/source/ui/Accessibility/AccessibleContextBase.cxx   |   30 -----------------
 sc/source/ui/inc/AccessibleContextBase.hxx             |    4 --
 svx/source/accessibility/AccessibleControlShape.cxx    |    3 +
 5 files changed, 2 insertions(+), 44 deletions(-)

New commits:
commit b5d4af2a7281df001fda8f3aed187b1e4fc10b72
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Thu Apr 10 17:35:41 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Apr 10 19:44:51 2025 +0200

    editeng a11y: Inline AccessibleContextBase::FireEvent to only caller
    
    Change-Id: Ia7ca4b39dc0917b05326e747820688eeb6c45343
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183978
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/editeng/source/accessibility/AccessibleContextBase.cxx 
b/editeng/source/accessibility/AccessibleContextBase.cxx
index 6841e7edfa36..af4ffeec864d 100644
--- a/editeng/source/accessibility/AccessibleContextBase.cxx
+++ b/editeng/source/accessibility/AccessibleContextBase.cxx
@@ -451,13 +451,6 @@ void AccessibleContextBase::CommitChange (
     NotifyAccessibleEvent(nEventId, rOldValue, rNewValue, nValueIndex);
 }
 
-
-void AccessibleContextBase::FireEvent (const AccessibleEventObject& aEvent)
-{
-    NotifyAccessibleEvent(aEvent.EventId, aEvent.OldValue, aEvent.NewValue, 
aEvent.IndexHint);
-}
-
-
 void AccessibleContextBase::ThrowIfDisposed()
 {
     if (rBHelper.bDisposed || rBHelper.bInDispose)
diff --git a/include/editeng/AccessibleContextBase.hxx 
b/include/editeng/AccessibleContextBase.hxx
index 7e362e5e0257..f9be0b195b36 100644
--- a/include/editeng/AccessibleContextBase.hxx
+++ b/include/editeng/AccessibleContextBase.hxx
@@ -273,8 +273,6 @@ protected:
     */
     virtual OUString CreateAccessibleName();
 
-    void FireEvent (const css::accessibility::AccessibleEventObject& aEvent);
-
     /** Check whether or not the object has been disposed (or is in the
         state of being disposed).  If that is the case then
         DisposedException is thrown to inform the (indirect) caller of the
diff --git a/svx/source/accessibility/AccessibleControlShape.cxx 
b/svx/source/accessibility/AccessibleControlShape.cxx
index 1933d9b0b6a4..5582a9330a72 100644
--- a/svx/source/accessibility/AccessibleControlShape.cxx
+++ b/svx/source/accessibility/AccessibleControlShape.cxx
@@ -423,7 +423,8 @@ void SAL_CALL AccessibleControlShape::notifyEvent( const 
AccessibleEventObject&
             m_pChildManager->handleChildNotification( _rEvent );
         }
 
-        FireEvent( aTranslatedEvent );
+        NotifyAccessibleEvent(_rEvent.EventId, _rEvent.OldValue, 
_rEvent.NewValue,
+                              _rEvent.IndexHint);
     }
 }
 
commit b37631e6ddd0f92ce07ac2ab4d4ba642f758f180
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Apr 9 16:00:59 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Apr 10 19:44:43 2025 +0200

    sc a11y: Drop ScAccessibleContextBase::getAccessibleIndexInParent
    
    The base class implementation in
    OAccessibleComponentHelper::getAccessibleIndexInParent
    is using the same approach already - and has the benefit
    of returning early when the child is found instead of
    continuing to iterate over all of the parent's children.
    
    Change-Id: I9ff67770bb4162c2c903a84b0393739a451d3893
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183942
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/sc/source/ui/Accessibility/AccessibleContextBase.cxx 
b/sc/source/ui/Accessibility/AccessibleContextBase.cxx
index f4d1a69c2c46..a0a8c764ce0e 100644
--- a/sc/source/ui/Accessibility/AccessibleContextBase.cxx
+++ b/sc/source/ui/Accessibility/AccessibleContextBase.cxx
@@ -160,36 +160,6 @@ uno::Reference<XAccessible> SAL_CALL
     return mxParent;
 }
 
-sal_Int64 SAL_CALL
-       ScAccessibleContextBase::getAccessibleIndexInParent()
-{
-    SolarMutexGuard aGuard;
-    ensureAlive();
-    //  Use a simple but slow solution for now.  Optimize later.
-   //   Return -1 to indicate that this object's parent does not know about the
-   //   object.
-    sal_Int64 nIndex(-1);
-
-    //  Iterate over all the parent's children and search for this object.
-    if (mxParent.is())
-    {
-        uno::Reference<XAccessibleContext> xParentContext (
-            mxParent->getAccessibleContext());
-        if (xParentContext.is())
-        {
-            sal_Int64 nChildCount = xParentContext->getAccessibleChildCount();
-            for (sal_Int64 i=0; i<nChildCount; ++i)
-            {
-                uno::Reference<XAccessible> xChild 
(xParentContext->getAccessibleChild (i));
-                if (xChild.is() && xChild.get() == this)
-                    nIndex = i;
-            }
-        }
-    }
-
-    return nIndex;
-}
-
 sal_Int16 SAL_CALL
     ScAccessibleContextBase::getAccessibleRole()
 {
diff --git a/sc/source/ui/inc/AccessibleContextBase.hxx 
b/sc/source/ui/inc/AccessibleContextBase.hxx
index bb30cf1a3f4a..526727e4a242 100644
--- a/sc/source/ui/inc/AccessibleContextBase.hxx
+++ b/sc/source/ui/inc/AccessibleContextBase.hxx
@@ -88,10 +88,6 @@ public:
     virtual css::uno::Reference< css::accessibility::XAccessible> SAL_CALL
         getAccessibleParent() override;
 
-    /// Return this objects index among the parents children.
-    virtual sal_Int64 SAL_CALL
-        getAccessibleIndexInParent() override;
-
     /// Return this object's role.
     virtual sal_Int16 SAL_CALL
         getAccessibleRole() override;

Reply via email to