diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-06-11 15:50:59 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-14 10:38:22 +0000 |
commit | 1c8051d533be8d6cd63ce384fdf92b96971279fd (patch) | |
tree | 3932a296393b02d47cfa26735517c8fee0ff7aec | |
parent | 36af72c6f6343f630c54f3e41b467d6bd312214d (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
(cherry picked from commit 0f32ba56a1e775e8ecd6c827ebd48f7f2fb51c81)
(cherry picked from commit 652026f0e2f9c323229151e854ad6591791e098e)
Change-Id: I16a9d86879e1a894c63932705c056268e98db7aa
Reviewed-on: https://gerrit.libreoffice.org/26186
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-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 98e3b28315f2..4b5e0458cc64 100644 --- a/accessibility/source/extended/AccessibleGridControl.cxx +++ b/accessibility/source/extended/AccessibleGridControl.cxx @@ -347,7 +347,14 @@ void AccessibleGridControl::commitTableEvent(sal_Int16 _nEventId,const Any& _rNe { if(_nEventId == AccessibleEventId::ACTIVE_DESCENDANT_CHANGED) { - Reference< 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) |