diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2017-05-17 23:24:24 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2017-05-18 00:31:22 +0300 |
commit | 005f4a75e129dcbc74261b90432e2944ca99b131 (patch) | |
tree | 20fbf73e25eb1edb64b1bde3fea82109dc570a41 /framework/source/uielement | |
parent | 7e6b62825032ff6610ab83c3e4f3b7085d2def0c (diff) |
Popup menu controllers never attached to empty menus
... in our xml files, only to plain menu items.
Change-Id: I1614a1b31a05e08cf317d2637d64d3e450855fc9
Diffstat (limited to 'framework/source/uielement')
-rw-r--r-- | framework/source/uielement/menubarmanager.cxx | 26 |
1 files changed, 2 insertions, 24 deletions
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<PopupMenu *>(pVCLXPopupMenu->GetMenu()); - pMenu->SetPopupMenu( nItemId, pNewPopupMenu ); - pItemHandler->xPopupMenu.set( static_cast<OWeakObject *>(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 ); |