diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-09-15 10:30:18 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-09-15 12:07:18 +0200 |
commit | 5ac2c503c04282b3b456ccb8bf39d886e568d1fa (patch) | |
tree | 169406c90c51f8b06b2f171fe429ddf983862e95 | |
parent | fcc49e118c9da28309dce3389d111a546cba19cd (diff) |
vcl menu: Make DeactivateMenuBar() virtual to eliminate IsMenuBar() call.
Change-Id: I33ba324a13e2addb678fb801222bd25a21c3ef1b
-rw-r--r-- | include/vcl/menu.hxx | 5 | ||||
-rw-r--r-- | vcl/source/window/menu.cxx | 22 |
2 files changed, 16 insertions, 11 deletions
diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx index 8045963174d6..db133e66d3d8 100644 --- a/include/vcl/menu.hxx +++ b/include/vcl/menu.hxx @@ -190,7 +190,7 @@ protected: virtual void CloseStartedFrom() = 0; /// Deactivate the MenuBarWindow. - SAL_DLLPRIVATE sal_uLong DeactivateMenuBar(sal_uLong nFocusId); + virtual sal_uLong DeactivateMenuBar(sal_uLong nFocusId); /// Forward the KeyInput call to the MenuBar. SAL_DLLPRIVATE void MenuBarKeyInput(const KeyEvent& rEvent); @@ -423,6 +423,9 @@ public: /// Close the 'pStartedFrom' menu window. virtual void CloseStartedFrom() SAL_OVERRIDE; + /// Deactivate the MenuBarWindow. + virtual sal_uLong DeactivateMenuBar(sal_uLong nFocusId) SAL_OVERRIDE; + void ShowCloseButton( bool bShow = true ); bool HasCloseButton() const { return mbCloseBtnVisible; } bool HasFloatButton() const { return mbFloatBtnVisible; } diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 0a58c2d9001d..60e2425ba3be 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2265,16 +2265,6 @@ bool Menu::HasValidEntries( bool bCheckPopups ) sal_uLong Menu::DeactivateMenuBar(sal_uLong nFocusId) { - if (!IsMenuBar()) - return nFocusId; - - nFocusId = ((MenuBarWindow*)(dynamic_cast<MenuBar*>(this))->ImplGetWindow())->GetFocusId(); - if (nFocusId) - { - ((MenuBarWindow*)(dynamic_cast<MenuBar*>(this))->ImplGetWindow())->SetFocusId(0); - ImplGetSVData()->maWinData.mbNoDeactivate = false; - } - return nFocusId; } @@ -2479,6 +2469,18 @@ void MenuBar::CloseStartedFrom() p->PopupClosed(this); } +sal_uLong MenuBar::DeactivateMenuBar(sal_uLong nFocusId) +{ + nFocusId = ((MenuBarWindow*)(dynamic_cast<MenuBar*>(this))->ImplGetWindow())->GetFocusId(); + if (nFocusId) + { + ((MenuBarWindow*)(dynamic_cast<MenuBar*>(this))->ImplGetWindow())->SetFocusId(0); + ImplGetSVData()->maWinData.mbNoDeactivate = false; + } + + return nFocusId; +} + void MenuBar::ShowCloseButton(bool bShow) { ShowButtons( bShow, mbFloatBtnVisible, mbHideBtnVisible ); |