accessibility/source/extended/AccessibleGridControlTable.cxx |   12 -----------
 1 file changed, 1 insertion(+), 11 deletions(-)

New commits:
commit dc4c55c51d52340c84e21da92d61d3488a253cd3
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Feb 23 14:08:11 2022 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Feb 24 07:21:12 2022 +0100

    a11y: Simplify AccessibleGridControlTable::getAccessibleCellAt
    
    Call 'AccessibleGridControlTable::getAccessibleChild'
    with the calculated child index instead of duplicating
    the handling to retrieve/create the proper
    accessible object.
    
    Change-Id: I8135f379f304d0e8ac61806eba9b3bd6c644f3a0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130443
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/accessibility/source/extended/AccessibleGridControlTable.cxx 
b/accessibility/source/extended/AccessibleGridControlTable.cxx
index 8938ba83a122..da634269b049 100644
--- a/accessibility/source/extended/AccessibleGridControlTable.cxx
+++ b/accessibility/source/extended/AccessibleGridControlTable.cxx
@@ -181,18 +181,8 @@ Reference< XAccessible > SAL_CALL 
AccessibleGridControlTable::getAccessibleCellA
 
     ensureIsAlive();
     ensureIsValidAddress( nRow, nColumn );
-    sal_Int32 nCount = getAccessibleChildCount();
     sal_Int32 nChildIndex = nRow*m_aTable.GetColumnCount() + nColumn;
-    if(m_aCellVector.empty() || m_aCellVector.size() != 
static_cast<unsigned>(nCount))
-    {
-        m_aCellVector.resize(nCount);
-    }
-    if(!m_aCellVector[nChildIndex].is())
-    {
-        rtl::Reference<AccessibleGridControlTableCell> pCell = new 
AccessibleGridControlTableCell(this, m_aTable, nRow, nColumn);
-        m_aCellVector[nChildIndex] = pCell;
-    }
-    return m_aCellVector[nChildIndex];
+    return getAccessibleChild(nChildIndex);
 }
 
 sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleSelected(

Reply via email to