summaryrefslogtreecommitdiff
path: root/vcl/source/window
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-08-02 13:08:39 +0100
committerAndras Timar <andras.timar@collabora.com>2016-08-15 10:25:54 +0200
commit448636b0c493ce8732d4d7e39dcce7337d342e28 (patch)
treeedfe47410c5199d93260a75985dd27924caeb87b /vcl/source/window
parent28faecec78b58d3cb9c5efcd61308f79deaa576d (diff)
Related: tdf#92516 make menu accelerators always work even if...
keyboard not used yet. The gtk2/3 menus appear to work this way. (And when not in gtk2/3 it shouldn't disable the accelerators for other platforms anyway) (cherry picked from commit f6d0d92a5e249413df99a7f3677a28efe6d45426) Change-Id: Ib7a99bd9039cd07120b3b77380f810b5b028fd57 Reviewed-on: https://gerrit.libreoffice.org/27795 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 1288a0682ab4c960915722d2bb52a200e75580a3)
Diffstat (limited to 'vcl/source/window')
-rw-r--r--vcl/source/window/menufloatingwindow.cxx13
1 files changed, 2 insertions, 11 deletions
diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx
index 1cb95ed18f87..b6d6c966ded2 100644
--- a/vcl/source/window/menufloatingwindow.cxx
+++ b/vcl/source/window/menufloatingwindow.cxx
@@ -1112,18 +1112,9 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent )
sal_Unicode nCharCode = rKEvent.GetCharCode();
sal_uInt16 nPos = 0;
sal_uInt16 nDuplicates = 0;
- MenuItemData* pData = (nCharCode && pMenu) ?
+ MenuItemData* pData = (nCharCode && pMenu && ImplGetSVData()->maNWFData.mbEnableAccel) ?
pMenu->GetItemList()->SearchItem(nCharCode, rKEvent.GetKeyCode(), nPos, nDuplicates, nHighlightedItem) : nullptr;
- bool bConsume = false;
- bool accel = ImplGetSVData()->maNWFData.mbEnableAccel;
- if (pData && accel)
- {
- Menu *men = pMenu;
- while (men && !men->IsMenuBar())
- men = men->pStartedFrom;
- bConsume = !men || (static_cast<MenuBarWindow*>(men->pWindow.get()))->GetMBWMenuKey();
- }
- if (bConsume)
+ if (pData)
{
if ( pData->pSubMenu || nDuplicates > 1 )
{