From 7da15debe39b50255cc08b3fef7ae38185a9174f Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 9 Mar 2016 14:30:32 +0200 Subject: loplugin:constantparam in framework Change-Id: I41c83b6214e3af7b3a40c8e00df5f100e39ebad7 --- framework/source/dispatch/menudispatcher.cxx | 32 +++------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) (limited to 'framework/source/dispatch') diff --git a/framework/source/dispatch/menudispatcher.cxx b/framework/source/dispatch/menudispatcher.cxx index 739b30cb336c..882e482a4df2 100644 --- a/framework/source/dispatch/menudispatcher.cxx +++ b/framework/source/dispatch/menudispatcher.cxx @@ -56,8 +56,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::util; using namespace ::cppu; -const sal_uInt16 SLOTID_MDIWINDOWLIST = 5610; - // constructor MenuDispatcher::MenuDispatcher( const uno::Reference< XComponentContext >& xContext , @@ -152,7 +150,7 @@ void SAL_CALL MenuDispatcher::frameAction( const FrameActionEvent& aEvent ) thro else if ( m_pMenuManager && aEvent.Action == css::frame::FrameAction_COMPONENT_DETACHING ) { if ( m_pMenuManager ) - impl_setMenuBar( nullptr ); + impl_clearMenuBar(); } } @@ -188,7 +186,7 @@ void SAL_CALL MenuDispatcher::disposing( const EventObject& ) throw( RuntimeExce // Remove our menu from system window if it is still there! if ( m_pMenuManager ) - impl_setMenuBar( nullptr ); + impl_clearMenuBar(); } } @@ -209,7 +207,7 @@ void MenuDispatcher::impl_setAccelerators( Menu* pMenu, const Accelerator& aAcce } } -bool MenuDispatcher::impl_setMenuBar( MenuBar* pMenuBar ) +bool MenuDispatcher::impl_clearMenuBar() { uno::Reference< XFrame > xFrame( m_xOwnerWeak.get(), UNO_QUERY ); if ( xFrame.is() ) @@ -242,30 +240,6 @@ bool MenuDispatcher::impl_setMenuBar( MenuBar* pMenuBar ) m_pMenuManager = nullptr; } - if ( pMenuBar != nullptr ) - { - sal_uInt16 nPos = pMenuBar->GetItemPos( SLOTID_MDIWINDOWLIST ); - if ( nPos != MENU_ITEM_NOTFOUND ) - { - uno::Reference< XModel > xModel; - uno::Reference< XController > xController( xFrame->getController(), UNO_QUERY ); - - if ( xController.is() ) - xModel.set( xController->getModel(), UNO_QUERY ); - - // retrieve addon popup menus and add them to our menu bar - AddonMenuManager::MergeAddonPopupMenus( xFrame, nPos, pMenuBar, m_xContext ); - - // retrieve addon help menu items and add them to our help menu - AddonMenuManager::MergeAddonHelpMenu( xFrame, pMenuBar, m_xContext ); - } - - // set new menu on our system window and create new menu manager - m_pMenuManager = new MenuManager( m_xContext, xFrame, pMenuBar, true, true ); - - pSysWindow->SetMenuBar( pMenuBar ); - } - return true; } } -- cgit