diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-28 16:01:34 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-28 20:09:41 +0200 |
commit | ada320547db4c7ddbb05d10df4140ea988f29973 (patch) | |
tree | 551cde16a671bc6e17ccb427a81aa6954ae2520a /accessibility/source | |
parent | dd97bfce9900e6bae40eece36124f8b22e70ff47 (diff) |
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>
Diffstat (limited to 'accessibility/source')
3 files changed, 17 insertions, 11 deletions
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<m_aTable.GetRowCount(); i++) - selectedRows[i]=i; + selectedRowsRange[i]=i; } sal_Int32 SAL_CALL AccessibleGridControlTable::getSelectedAccessibleChildCount() { diff --git a/accessibility/source/extended/AccessibleGridControlTableBase.cxx b/accessibility/source/extended/AccessibleGridControlTableBase.cxx index a3d17b4711c3..7ed42bc6b830 100644 --- a/accessibility/source/extended/AccessibleGridControlTableBase.cxx +++ b/accessibility/source/extended/AccessibleGridControlTableBase.cxx @@ -203,8 +203,9 @@ void AccessibleGridControlTableBase::implGetSelectedRows( Sequence< sal_Int32 >& { sal_Int32 const selectionCount( m_aTable.GetSelectedRowCount() ); rSeq.realloc( selectionCount ); + auto pSeq = rSeq.getArray(); 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 ) diff --git a/accessibility/source/standard/vclxaccessiblemenuitem.cxx b/accessibility/source/standard/vclxaccessiblemenuitem.cxx index 8ad81ee06ed9..96e31c0074b1 100644 --- a/accessibility/source/standard/vclxaccessiblemenuitem.cxx +++ b/accessibility/source/standard/vclxaccessiblemenuitem.cxx @@ -454,7 +454,7 @@ Reference< XAccessibleKeyBinding > 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 ); } } |