summaryrefslogtreecommitdiff
path: root/accessibility
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-06-11 15:50:59 +0100
committerAndras Timar <andras.timar@collabora.com>2016-06-18 20:54:13 +0200
commitadf3198227b2b5072c28e86f3e61e660af095d7c (patch)
tree1fc029e8a38d3ba0b6144e563a1a5068cae0ea26 /accessibility
parentc4a6f2f7bbada7534beeb5211028d03374a532d9 (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> (cherry picked from commit 1c8051d533be8d6cd63ce384fdf92b96971279fd)
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 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)