summaryrefslogtreecommitdiff
path: root/accessibility
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-06-11 15:50:59 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-06-11 15:53:12 +0100
commit0f32ba56a1e775e8ecd6c827ebd48f7f2fb51c81 (patch)
tree8b33f22701850483d65b96cb77bc5abe3aa86860 /accessibility
parent99226f343e4ad9ebcbb4e31c17d3fb706153e18b (diff)
Resolves: tdf#100272 row ally index is ROW_INVALID
which is < 0 so bad things happen, consider ROW_INVALID/COL_INVALID before looking for a11y child at that index Change-Id: I16a9d86879e1a894c63932705c056268e98db7aa
Diffstat (limited to 'accessibility')
-rw-r--r--accessibility/source/extended/AccessibleGridControl.cxx9
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)