Resolves: tdf#163777 Ignore pageup and down when modifier held...

in a SalInstanceEntryTreeView, otherwise the ctrl+pageup/down gets
processed twice by the toplevel notebook due to the forwarding used
here.

Change-Id: Ic5003064ddba44f940fb4c4a727d8081c3644361
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177277
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Caolán McNamara
2024-11-25 16:49:52 +00:00
parent 4178b34521
commit 8f0a2c52f6

View File

@@ -6961,9 +6961,12 @@ IMPL_LINK(SalInstanceEntryTreeView, KeyPressListener, VclWindowEvent&, rEvent, v
if (rEvent.GetId() != VclEventId::WindowKeyInput)
return;
const KeyEvent& rKeyEvent = *static_cast<KeyEvent*>(rEvent.GetData());
if (rKeyEvent.GetKeyCode().GetModifier()) // tdf#163777 ignore when modifier held
return;
sal_uInt16 nKeyCode = rKeyEvent.GetKeyCode().GetCode();
if (!(nKeyCode == KEY_UP || nKeyCode == KEY_DOWN || nKeyCode == KEY_PAGEUP
|| nKeyCode == KEY_PAGEDOWN))
const bool bNavigation = nKeyCode == KEY_UP || nKeyCode == KEY_DOWN || nKeyCode == KEY_PAGEUP
|| nKeyCode == KEY_PAGEDOWN;
if (!bNavigation)
return;
m_pTreeView->disable_notify_events();