From 005f4a75e129dcbc74261b90432e2944ca99b131 Mon Sep 17 00:00:00 2001 From: Maxim Monastirsky Date: Wed, 17 May 2017 23:24:24 +0300 Subject: Popup menu controllers never attached to empty menus ... in our xml files, only to plain menu items. Change-Id: I1614a1b31a05e08cf317d2637d64d3e450855fc9 --- framework/source/uielement/menubarmanager.cxx | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) (limited to 'framework/source/uielement') diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 3a1b2bd4d157..499b207133e4 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -1147,31 +1147,9 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF pMenu->SetHelpCommand( nItemId, "" ); } - if ( m_xPopupMenuControllerFactory.is() && - pPopup->GetItemCount() == 0 && - m_xPopupMenuControllerFactory->hasController( aItemCommand, m_aModuleIdentifier ) - ) - { - // Check if we have to create a popup menu for a uno based popup menu controller. - // We have to set an empty popup menu into our menu structure so the controller also - // works with inplace OLE. Remove old dummy popup menu! - MenuItemHandler* pItemHandler = new MenuItemHandler( nItemId, xStatusListener, xDispatch ); - VCLXPopupMenu* pVCLXPopupMenu = new VCLXPopupMenu; - PopupMenu* pNewPopupMenu = static_cast(pVCLXPopupMenu->GetMenu()); - pMenu->SetPopupMenu( nItemId, pNewPopupMenu ); - pItemHandler->xPopupMenu.set( static_cast(pVCLXPopupMenu), UNO_QUERY ); - pItemHandler->aMenuItemURL = aItemCommand; - m_aMenuItemHandlerVector.push_back( pItemHandler ); - pPopup.disposeAndClear(); + assert(!m_xPopupMenuControllerFactory.is() || !m_xPopupMenuControllerFactory->hasController( aItemCommand, m_aModuleIdentifier )); - if ( bAccessibilityEnabled ) - { - if ( CreatePopupMenuController( pItemHandler )) - pItemHandler->xPopupMenuController->updatePopupMenu(); - } - lcl_CheckForChildren(pMenu, nItemId); - } - else if ( aItemCommand.startsWith( ADDONSPOPUPMENU_URL_PREFIX_STR ) ) + if ( aItemCommand.startsWith( ADDONSPOPUPMENU_URL_PREFIX_STR ) ) { // A special addon popup menu, must be created with a different ctor MenuBarManager* pSubMenuManager = new MenuBarManager( m_xContext, m_xFrame, m_xURLTransformer, pPopup, true ); -- cgit