Prepare for removal of non-const operator[] from Sequence in accessibility

Change-Id: I9454befb46767255451c490eab17e331eb8bb9dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124334
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski
2021-10-28 16:01:34 +03:00
parent dd97bfce99
commit ada320547d
3 changed files with 17 additions and 11 deletions

View File

@@ -238,8 +238,9 @@ void SAL_CALL AccessibleGridControlTable::selectAllAccessibleChildren()
ensureIsAlive(); ensureIsAlive();
Sequence< sal_Int32 > selectedRows = getSelectedAccessibleRows(); Sequence< sal_Int32 > selectedRows = getSelectedAccessibleRows();
auto selectedRowsRange = asNonConstRange(selectedRows);
for(tools::Long i=0; i<m_aTable.GetRowCount(); i++) for(tools::Long i=0; i<m_aTable.GetRowCount(); i++)
selectedRows[i]=i; selectedRowsRange[i]=i;
} }
sal_Int32 SAL_CALL AccessibleGridControlTable::getSelectedAccessibleChildCount() sal_Int32 SAL_CALL AccessibleGridControlTable::getSelectedAccessibleChildCount()
{ {

View File

@@ -203,8 +203,9 @@ void AccessibleGridControlTableBase::implGetSelectedRows( Sequence< sal_Int32 >&
{ {
sal_Int32 const selectionCount( m_aTable.GetSelectedRowCount() ); sal_Int32 const selectionCount( m_aTable.GetSelectedRowCount() );
rSeq.realloc( selectionCount ); rSeq.realloc( selectionCount );
auto pSeq = rSeq.getArray();
for ( sal_Int32 i=0; i<selectionCount; ++i ) for ( sal_Int32 i=0; i<selectionCount; ++i )
rSeq[i] = m_aTable.GetSelectedRowIndex(i); pSeq[i] = m_aTable.GetSelectedRowIndex(i);
} }
void AccessibleGridControlTableBase::ensureIsValidRow( sal_Int32 nRow ) void AccessibleGridControlTableBase::ensureIsValidRow( sal_Int32 nRow )

View File

@@ -454,7 +454,7 @@ Reference< XAccessibleKeyBinding > VCLXAccessibleMenuItem::getAccessibleActionKe
{ {
Reference< XAccessibleContext > xParentContext( xParent->getAccessibleContext() ); Reference< XAccessibleContext > xParentContext( xParent->getAccessibleContext() );
if ( xParentContext.is() && xParentContext->getAccessibleRole() == AccessibleRole::MENU_BAR ) if ( xParentContext.is() && xParentContext->getAccessibleRole() == AccessibleRole::MENU_BAR )
aSeq1[0].Modifiers |= awt::KeyModifier::MOD2; aSeq1.getArray()[0].Modifiers |= awt::KeyModifier::MOD2;
} }
pKeyBindingHelper->AddKeyBinding( aSeq1 ); pKeyBindingHelper->AddKeyBinding( aSeq1 );
@@ -490,14 +490,18 @@ Reference< XAccessibleKeyBinding > VCLXAccessibleMenuItem::getAccessibleActionKe
static_cast< sal_Int16 >(aAccelKeyCode.GetFunction()) static_cast< sal_Int16 >(aAccelKeyCode.GetFunction())
} }
}; };
if ( aAccelKeyCode.IsShift() ) if (aAccelKeyCode.GetModifier() != 0)
aSeq3[0].Modifiers |= awt::KeyModifier::SHIFT; {
if ( aAccelKeyCode.IsMod1() ) auto pSeq3 = aSeq3.getArray();
aSeq3[0].Modifiers |= awt::KeyModifier::MOD1; if ( aAccelKeyCode.IsShift() )
if ( aAccelKeyCode.IsMod2() ) pSeq3[0].Modifiers |= awt::KeyModifier::SHIFT;
aSeq3[0].Modifiers |= awt::KeyModifier::MOD2; if ( aAccelKeyCode.IsMod1() )
if ( aAccelKeyCode.IsMod3() ) pSeq3[0].Modifiers |= awt::KeyModifier::MOD1;
aSeq3[0].Modifiers |= awt::KeyModifier::MOD3; if ( aAccelKeyCode.IsMod2() )
pSeq3[0].Modifiers |= awt::KeyModifier::MOD2;
if ( aAccelKeyCode.IsMod3() )
pSeq3[0].Modifiers |= awt::KeyModifier::MOD3;
}
pKeyBindingHelper->AddKeyBinding( aSeq3 ); pKeyBindingHelper->AddKeyBinding( aSeq3 );
} }
} }