summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2014-09-15 23:12:58 +0200
committerJan Holesovsky <kendy@collabora.com>2014-09-16 10:14:08 +0200
commitd2d8cda6c2bf93149acbe9a04389d056709d7ed2 (patch)
tree94ef832ddec3f0b3b45a7a235d3abc8297a4e3d5 /vcl
parente6b9651756abd339dbbec6b0540ea4fd1f41fec2 (diff)
vcl menu: Make SelectItem() virtual to eliminate IsMenuBar() call.
Award for the sickiest usage of IsMenuBar(). Change-Id: I194b983b61d0106b3628d364f08b261a03c0c42c
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/menu.cxx12
1 files changed, 2 insertions, 10 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 16a5ca592fce..01ee1626237b 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1352,14 +1352,6 @@ bool Menu::ImplIsSelectable( sal_uInt16 nPos ) const
return bSelectable;
}
-void Menu::SelectItem( sal_uInt16 nItemId )
-{
- if (IsMenuBar())
- static_cast<MenuBar*>(this)->SelectEntry( nItemId );
- else
- static_cast<PopupMenu*>(this)->SelectEntry( nItemId );
-}
-
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > Menu::GetAccessible()
{
// Since PopupMenu are sometimes shared by different instances of MenuBar, the mxAccessible member gets
@@ -2521,7 +2513,7 @@ bool MenuBar::ImplHandleKeyEvent( const KeyEvent& rKEvent, bool bFromMenu )
return bDone;
}
-void MenuBar::SelectEntry( sal_uInt16 nId )
+void MenuBar::SelectItem(sal_uInt16 nId)
{
MenuBarWindow* pMenuWin = (MenuBarWindow*) ImplGetWindow();
@@ -2721,7 +2713,7 @@ void PopupMenu::EndExecute( sal_uInt16 nSelectId )
ImplGetFloatingWindow()->EndExecute( nSelectId );
}
-void PopupMenu::SelectEntry( sal_uInt16 nId )
+void PopupMenu::SelectItem(sal_uInt16 nId)
{
if ( ImplGetWindow() )
{