[Libreoffice-commits] core.git: accessibility/inc accessibility/source

Arnaud Versini (via logerrit) logerrit at kemper.freedesktop.org
Sun Nov 29 10:00:32 UTC 2020


 accessibility/inc/extended/AccessibleGridControl.hxx    |    3 +++
 accessibility/source/extended/AccessibleGridControl.cxx |   11 ++++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 613c55115a57dc2dcdf4212e79259d4d1be2979c
Author:     Arnaud Versini <arnaud.versini at libreoffice.org>
AuthorDate: Sat Nov 28 14:24:41 2020 +0100
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Nov 29 10:59:57 2020 +0100

    a11y : avoid double locking
    
    Change-Id: I1348fb33b9c93d54cd128bf6ac56a3c4c57eec3b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106806
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/accessibility/inc/extended/AccessibleGridControl.hxx b/accessibility/inc/extended/AccessibleGridControl.hxx
index 3140db59e395..5584fe5ed01b 100644
--- a/accessibility/inc/extended/AccessibleGridControl.hxx
+++ b/accessibility/inc/extended/AccessibleGridControl.hxx
@@ -151,6 +151,9 @@ private:
 
     /** The table cell child. */
     rtl::Reference<AccessibleGridControlTableCell>            m_xCell;
+
+    /** @return  The count of visible children. */
+    inline sal_Int32 implGetAccessibleChildCount();
 };
 
 
diff --git a/accessibility/source/extended/AccessibleGridControl.cxx b/accessibility/source/extended/AccessibleGridControl.cxx
index 5738c6f3fd98..2c41881fb4f3 100644
--- a/accessibility/source/extended/AccessibleGridControl.cxx
+++ b/accessibility/source/extended/AccessibleGridControl.cxx
@@ -77,14 +77,19 @@ void SAL_CALL AccessibleGridControl::disposing()
     AccessibleGridControlBase::disposing();
 }
 
+sal_Int32 AccessibleGridControl::implGetAccessibleChildCount()
+{
+    return m_aTable.GetAccessibleControlCount();
+}
 
 // css::accessibility::XAccessibleContext ---------------------------------------------------------
 
+
 sal_Int32 SAL_CALL AccessibleGridControl::getAccessibleChildCount()
 {
     SolarMutexGuard aSolarGuard;
     ensureIsAlive();
-    return m_aTable.GetAccessibleControlCount();
+    return implGetAccessibleChildCount();
 }
 
 
@@ -93,7 +98,7 @@ AccessibleGridControl::getAccessibleChild( sal_Int32 nChildIndex )
 {
     SolarMutexGuard aSolarGuard;
 
-    if (nChildIndex<0 || nChildIndex>=getAccessibleChildCount())
+    if (nChildIndex<0 || nChildIndex>=implGetAccessibleChildCount())
         throw IndexOutOfBoundsException();
 
     css::uno::Reference< css::accessibility::XAccessible > xChild;
@@ -264,7 +269,7 @@ AccessibleGridControlTable* AccessibleGridControl::createAccessibleTable()
 
 void AccessibleGridControl::commitCellEvent(sal_Int16 _nEventId,const Any& _rNewValue,const Any& _rOldValue)
 {
-    sal_Int32 nChildCount = getAccessibleChildCount();
+    sal_Int32 nChildCount = implGetAccessibleChildCount();
     if(nChildCount != 0)
     {
         for(sal_Int32 i=0;i<nChildCount;i++)


More information about the Libreoffice-commits mailing list