summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-02-23 19:36:37 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-02-24 10:07:39 +0100
commit00c1d85fabe426efdf6833b8034b041f1263d702 (patch)
tree9a63bec444a6d9a179b20fd0c68de6edc9418537
parent9dd5b8df8f300217fc0d4af6170b0bcc19a70fe8 (diff)
hide MenuBar details
Change-Id: I409a4df7703300e920511c28263634a00c7c6da7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111432 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--dbaccess/source/ui/app/AppControllerGen.cxx11
-rw-r--r--include/vcl/syswin.hxx2
-rw-r--r--vcl/source/window/syswin.cxx11
3 files changed, 15 insertions, 9 deletions
diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx b/dbaccess/source/ui/app/AppControllerGen.cxx
index 28b4c4053da3..632523e76977 100644
--- a/dbaccess/source/ui/app/AppControllerGen.cxx
+++ b/dbaccess/source/ui/app/AppControllerGen.cxx
@@ -52,7 +52,6 @@
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/diagnose_ex.h>
#include <osl/diagnose.h>
-#include <vcl/menu.hxx>
#include <vcl/mnemonic.hxx>
#include <vcl/svapp.hxx>
#include <vcl/syswin.hxx>
@@ -648,14 +647,8 @@ void OApplicationController::onLoadedMenu(const Reference< css::frame::XLayoutMa
// we need to share the "mnemonic space":
MnemonicGenerator aMnemonicGenerator;
// - the menu already has mnemonics
- SystemWindow* pSystemWindow = getContainer()->GetSystemWindow();
- MenuBar* pMenu = pSystemWindow ? pSystemWindow->GetMenuBar() : nullptr;
- if ( pMenu )
- {
- sal_uInt16 nMenuItems = pMenu->GetItemCount();
- for ( sal_uInt16 i = 0; i < nMenuItems; ++i )
- aMnemonicGenerator.RegisterMnemonic( pMenu->GetItemText( pMenu->GetItemId( i ) ) );
- }
+ if (SystemWindow* pSystemWindow = getContainer()->GetSystemWindow())
+ pSystemWindow->CollectMenuBarMnemonics(aMnemonicGenerator);
// - the icons should use automatic ones
getContainer()->createIconAutoMnemonics( aMnemonicGenerator );
// - as well as the entries in the task pane
diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx
index fee6afe96917..8b728a1af912 100644
--- a/include/vcl/syswin.hxx
+++ b/include/vcl/syswin.hxx
@@ -31,6 +31,7 @@
class SalInstanceBuilder;
class ScreenshotTest;
class MenuBar;
+class MnemonicGenerator;
class NotebookBar;
class TaskPaneList;
class VclBuilder;
@@ -193,6 +194,7 @@ public:
void SetMenuBar(MenuBar* pMenuBar);
MenuBar* GetMenuBar() const { return mpMenuBar; }
void SetMenuBarMode( MenuBarMode nMode );
+ void CollectMenuBarMnemonics(MnemonicGenerator& rMnemonicGenerator) const;
void SetNotebookBar(const OUString& rUIXMLDescription,
const css::uno::Reference<css::frame::XFrame>& rFrame,
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index 8e396207df92..b204135036bd 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -25,6 +25,7 @@
#include <vcl/accel.hxx>
#include <vcl/layout.hxx>
+#include <vcl/mnemonic.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
#include <vcl/menu.hxx>
@@ -1200,4 +1201,14 @@ void SystemWindow::ensureRepaint()
}
}
+void SystemWindow::CollectMenuBarMnemonics(MnemonicGenerator& rMnemonicGenerator) const
+{
+ if (MenuBar* pMenu = GetMenuBar())
+ {
+ sal_uInt16 nMenuItems = pMenu->GetItemCount();
+ for ( sal_uInt16 i = 0; i < nMenuItems; ++i )
+ rMnemonicGenerator.RegisterMnemonic( pMenu->GetItemText( pMenu->GetItemId( i ) ) );
+ }
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */