[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - accessibility/source

Caolán McNamara caolanm at redhat.com
Sat Jun 11 14:55:28 UTC 2016


 accessibility/source/extended/AccessibleGridControl.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 652026f0e2f9c323229151e854ad6591791e098e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jun 11 15:50:59 2016 +0100

    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
    (cherry picked from commit 0f32ba56a1e775e8ecd6c827ebd48f7f2fb51c81)

diff --git a/accessibility/source/extended/AccessibleGridControl.cxx b/accessibility/source/extended/AccessibleGridControl.cxx
index 5c32dcf..5ba4001 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)


More information about the Libreoffice-commits mailing list