From ada320547db4c7ddbb05d10df4140ea988f29973 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Thu, 28 Oct 2021 16:01:34 +0300 Subject: 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 --- .../source/extended/AccessibleGridControlTable.cxx | 3 ++- .../extended/AccessibleGridControlTableBase.cxx | 3 ++- .../source/standard/vclxaccessiblemenuitem.cxx | 22 +++++++++++++--------- 3 files changed, 17 insertions(+), 11 deletions(-) (limited to 'accessibility/source') diff --git a/accessibility/source/extended/AccessibleGridControlTable.cxx b/accessibility/source/extended/AccessibleGridControlTable.cxx index ffb8108d0f24..8938ba83a122 100644 --- a/accessibility/source/extended/AccessibleGridControlTable.cxx +++ b/accessibility/source/extended/AccessibleGridControlTable.cxx @@ -238,8 +238,9 @@ void SAL_CALL AccessibleGridControlTable::selectAllAccessibleChildren() ensureIsAlive(); Sequence< sal_Int32 > selectedRows = getSelectedAccessibleRows(); + auto selectedRowsRange = asNonConstRange(selectedRows); for(tools::Long i=0; i& { sal_Int32 const selectionCount( m_aTable.GetSelectedRowCount() ); rSeq.realloc( selectionCount ); + auto pSeq = rSeq.getArray(); for ( sal_Int32 i=0; i VCLXAccessibleMenuItem::getAccessibleActionKe { Reference< XAccessibleContext > xParentContext( xParent->getAccessibleContext() ); if ( xParentContext.is() && xParentContext->getAccessibleRole() == AccessibleRole::MENU_BAR ) - aSeq1[0].Modifiers |= awt::KeyModifier::MOD2; + aSeq1.getArray()[0].Modifiers |= awt::KeyModifier::MOD2; } pKeyBindingHelper->AddKeyBinding( aSeq1 ); @@ -490,14 +490,18 @@ Reference< XAccessibleKeyBinding > VCLXAccessibleMenuItem::getAccessibleActionKe static_cast< sal_Int16 >(aAccelKeyCode.GetFunction()) } }; - if ( aAccelKeyCode.IsShift() ) - aSeq3[0].Modifiers |= awt::KeyModifier::SHIFT; - if ( aAccelKeyCode.IsMod1() ) - aSeq3[0].Modifiers |= awt::KeyModifier::MOD1; - if ( aAccelKeyCode.IsMod2() ) - aSeq3[0].Modifiers |= awt::KeyModifier::MOD2; - if ( aAccelKeyCode.IsMod3() ) - aSeq3[0].Modifiers |= awt::KeyModifier::MOD3; + if (aAccelKeyCode.GetModifier() != 0) + { + auto pSeq3 = aSeq3.getArray(); + if ( aAccelKeyCode.IsShift() ) + pSeq3[0].Modifiers |= awt::KeyModifier::SHIFT; + if ( aAccelKeyCode.IsMod1() ) + pSeq3[0].Modifiers |= awt::KeyModifier::MOD1; + if ( aAccelKeyCode.IsMod2() ) + pSeq3[0].Modifiers |= awt::KeyModifier::MOD2; + if ( aAccelKeyCode.IsMod3() ) + pSeq3[0].Modifiers |= awt::KeyModifier::MOD3; + } pKeyBindingHelper->AddKeyBinding( aSeq3 ); } } -- cgit