a11y: Leave cell vector handling to AccessibleGridControlTable
Use `AccessibleGridControlTable::getAccessibleCellAt` and
cast to `AccessibleGridControlTableCell*` instead of
directly accessing the cell vector in
`AccessibleGridControl::commitCellEvent`.
`AccessibleGridControlTable::getAccessibleCellAt`
just needs row and column index as parameters,
and already takes care of everything else that's
needed.
This includes creating an accessible object for
the given indices on demand.
Therefore, limiting this to only already existing
a11y objects, which was done to avoid crashes in
commit 4fc7deb7b0
Date: Thu Oct 3 23:16:34 2013 +0200
fix STL assert in accessibility::AccessibleGridControl::commitTableEvent
is no longer needed.
With this change in place, details of how cells are
organized in the vector only need to be known inside
of the `AccessibleGridControlTable` class itself, so
drop the now unused method
`AccessibleGridControlTable::getCellVector`.
(This code path is e.g. used when using
the macro from tdf#147742.)
Change-Id: I21027f0edc2904475ad6cc5fb136316f387499dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131248
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
@@ -142,9 +142,6 @@ public:
|
|||||||
// XComponent
|
// XComponent
|
||||||
virtual void SAL_CALL dispose() override;
|
virtual void SAL_CALL dispose() override;
|
||||||
|
|
||||||
/**@return m_pCellVector*/
|
|
||||||
std::vector< rtl::Reference<AccessibleGridControlTableCell> >& getCellVector() { return m_aCellVector;}
|
|
||||||
|
|
||||||
virtual void commitEvent(sal_Int16 nEventId, const css::uno::Any& rNewValue,
|
virtual void commitEvent(sal_Int16 nEventId, const css::uno::Any& rNewValue,
|
||||||
const css::uno::Any& rOldValue) override;
|
const css::uno::Any& rOldValue) override;
|
||||||
|
|
||||||
|
@@ -270,15 +270,10 @@ void AccessibleGridControl::commitCellEvent(sal_Int16 _nEventId,const Any& _rNew
|
|||||||
css::uno::Reference< css::accessibility::XAccessible > xAccessible = getAccessibleChild(i);
|
css::uno::Reference< css::accessibility::XAccessible > xAccessible = getAccessibleChild(i);
|
||||||
if(css::uno::Reference< css::accessibility::XAccessible >(m_xTable) == xAccessible)
|
if(css::uno::Reference< css::accessibility::XAccessible >(m_xTable) == xAccessible)
|
||||||
{
|
{
|
||||||
std::vector< rtl::Reference<AccessibleGridControlTableCell> >& rCells =
|
Reference<XAccessible> xCell = m_xTable->getAccessibleCellAt(
|
||||||
m_xTable->getCellVector();
|
m_aTable.GetCurrentRow(), m_aTable.GetCurrentColumn());
|
||||||
size_t nIndex = m_aTable.GetCurrentRow() * m_aTable.GetColumnCount()
|
AccessibleGridControlTableCell* pCell = static_cast<AccessibleGridControlTableCell*>(xCell.get());
|
||||||
+ m_aTable.GetCurrentColumn();
|
pCell->commitEvent(_nEventId, _rNewValue, _rOldValue);
|
||||||
if (nIndex < rCells.size() && rCells[nIndex])
|
|
||||||
{
|
|
||||||
rtl::Reference<AccessibleGridControlTableCell> xCell = rCells[nIndex];
|
|
||||||
xCell->commitEvent( _nEventId, _rNewValue, _rOldValue );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user