diff options
Diffstat (limited to 'accessibility/source/extended/AccessibleGridControl.cxx')
-rw-r--r-- | accessibility/source/extended/AccessibleGridControl.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/accessibility/source/extended/AccessibleGridControl.cxx b/accessibility/source/extended/AccessibleGridControl.cxx index d647bc8b0e4f..b51558ca2738 100644 --- a/accessibility/source/extended/AccessibleGridControl.cxx +++ b/accessibility/source/extended/AccessibleGridControl.cxx @@ -345,7 +345,14 @@ void AccessibleGridControl::commitTableEvent(sal_Int16 _nEventId,const Any& _rNe { if(_nEventId == AccessibleEventId::ACTIVE_DESCENDANT_CHANGED) { - css::uno::Reference< css::accessibility::XAccessible > xChild = m_xImpl->m_pTable->getAccessibleChild(m_aTable.GetCurrentRow()*m_aTable.GetColumnCount()+m_aTable.GetCurrentColumn()); + const sal_Int32 nCurrentRow = m_aTable.GetCurrentRow(); + const sal_Int32 nCurrentCol = m_aTable.GetCurrentColumn(); + css::uno::Reference< css::accessibility::XAccessible > xChild; + if (nCurrentRow > -1 && nCurrentCol > -1) + { + sal_Int32 nColumnCount = m_aTable.GetColumnCount(); + xChild = m_xImpl->m_pTable->getAccessibleChild(nCurrentRow * nCurrentCol + nColumnCount); + } m_xImpl->m_pTable->commitEvent(_nEventId, makeAny(xChild),_rOldValue); } else if(_nEventId == AccessibleEventId::TABLE_MODEL_CHANGED) |