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

Caolán McNamara caolanm at redhat.com
Tue Jun 14 10:38:47 UTC 2016


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

New commits:
commit 1c8051d533be8d6cd63ce384fdf92b96971279fd
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
    
    (cherry picked from commit 0f32ba56a1e775e8ecd6c827ebd48f7f2fb51c81)
    (cherry picked from commit 652026f0e2f9c323229151e854ad6591791e098e)
    
    Change-Id: I16a9d86879e1a894c63932705c056268e98db7aa
    Reviewed-on: https://gerrit.libreoffice.org/26186
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/accessibility/source/extended/AccessibleGridControl.cxx b/accessibility/source/extended/AccessibleGridControl.cxx
index 98e3b28..4b5e045 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)


More information about the Libreoffice-commits mailing list