summaryrefslogtreecommitdiff
path: root/accessibility
diff options
context:
space:
mode:
authorArnaud Versini <arnaud.versini@libreoffice.org>2020-11-28 14:24:41 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-29 10:59:57 +0100
commit613c55115a57dc2dcdf4212e79259d4d1be2979c (patch)
treea4288337e7709fb902b6c99a399c8f63fa957e56 /accessibility
parent836b9c08b11f386e243a5a074a169b2cb2c2b93e (diff)
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@collabora.co.uk>
Diffstat (limited to 'accessibility')
-rw-r--r--accessibility/inc/extended/AccessibleGridControl.hxx3
-rw-r--r--accessibility/source/extended/AccessibleGridControl.cxx11
2 files changed, 11 insertions, 3 deletions
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++)