diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2021-10-17 12:12:22 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-10-17 22:05:27 +0200 |
commit | c82aa206ab496248dd107c41ff5f66ec5a2399ac (patch) | |
tree | 21aee44c2b6b25ab9fadfa717da471f0c881db0c /accessibility | |
parent | 3059d56c9d91b7450e2229b2baee0ddc2cf8fa0d (diff) |
Simplify Sequence in accessibility
+ retrieve a missing aKeyEvent.GetCharCode() aSeq3
Change-Id: If575513996304f67b8e87a145052cb1b9279a212
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123719
Tested-by: Jenkins
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'accessibility')
-rw-r--r-- | accessibility/source/standard/vclxaccessiblemenuitem.cxx | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/accessibility/source/standard/vclxaccessiblemenuitem.cxx b/accessibility/source/standard/vclxaccessiblemenuitem.cxx index f8b125c1400e..8ad81ee06ed9 100644 --- a/accessibility/source/standard/vclxaccessiblemenuitem.cxx +++ b/accessibility/source/standard/vclxaccessiblemenuitem.cxx @@ -440,8 +440,15 @@ Reference< XAccessibleKeyBinding > VCLXAccessibleMenuItem::getAccessibleActionKe // activation key KeyEvent aKeyEvent = m_pParent->GetActivationKey( m_pParent->GetItemId( m_nItemPos ) ); vcl::KeyCode aKeyCode = aKeyEvent.GetKeyCode(); - Sequence< awt::KeyStroke > aSeq1(1); - aSeq1[0].Modifiers = 0; + Sequence< awt::KeyStroke > aSeq1 + { + { + 0, // Modifiers + static_cast< sal_Int16 >(aKeyCode.GetCode()), + aKeyEvent.GetCharCode(), + static_cast< sal_Int16 >( aKeyCode.GetFunction()) + } + }; Reference< XAccessible > xParent( getAccessibleParent() ); if ( xParent.is() ) { @@ -449,9 +456,6 @@ Reference< XAccessibleKeyBinding > VCLXAccessibleMenuItem::getAccessibleActionKe if ( xParentContext.is() && xParentContext->getAccessibleRole() == AccessibleRole::MENU_BAR ) aSeq1[0].Modifiers |= awt::KeyModifier::MOD2; } - aSeq1[0].KeyCode = aKeyCode.GetCode(); - aSeq1[0].KeyChar = aKeyEvent.GetCharCode(); - aSeq1[0].KeyFunc = static_cast< sal_Int16 >( aKeyCode.GetFunction() ); pKeyBindingHelper->AddKeyBinding( aSeq1 ); // complete menu activation key sequence @@ -477,8 +481,15 @@ Reference< XAccessibleKeyBinding > VCLXAccessibleMenuItem::getAccessibleActionKe vcl::KeyCode aAccelKeyCode = m_pParent->GetAccelKey( m_pParent->GetItemId( m_nItemPos ) ); if ( aAccelKeyCode.GetCode() != 0 ) { - Sequence< awt::KeyStroke > aSeq3(1); - aSeq3[0].Modifiers = 0; + Sequence< awt::KeyStroke > aSeq3 + { + { + 0, // Modifiers + static_cast< sal_Int16 >(aAccelKeyCode.GetCode()), + aKeyEvent.GetCharCode(), + static_cast< sal_Int16 >(aAccelKeyCode.GetFunction()) + } + }; if ( aAccelKeyCode.IsShift() ) aSeq3[0].Modifiers |= awt::KeyModifier::SHIFT; if ( aAccelKeyCode.IsMod1() ) @@ -487,8 +498,6 @@ Reference< XAccessibleKeyBinding > VCLXAccessibleMenuItem::getAccessibleActionKe aSeq3[0].Modifiers |= awt::KeyModifier::MOD2; if ( aAccelKeyCode.IsMod3() ) aSeq3[0].Modifiers |= awt::KeyModifier::MOD3; - aSeq3[0].KeyCode = aAccelKeyCode.GetCode(); - aSeq3[0].KeyFunc = static_cast< sal_Int16 >( aAccelKeyCode.GetFunction() ); pKeyBindingHelper->AddKeyBinding( aSeq3 ); } } |