diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-01-21 12:41:39 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-01-21 14:49:41 +0000 |
commit | 1dbc6d05ded0dc1df75f7b9ff779571c98800035 (patch) | |
tree | bb760a852f67cf16b9edec22751a8b7fb440caf4 /framework/source/uielement/newmenucontroller.cxx | |
parent | 44b2fb6d0ba8c3fc8aa6edb4e539c484e21b7fc5 (diff) |
Resolves: fdo#87636 New button not clickable when Templates preselected
regression from
commit 57207cab004cb78c3fa6d9ed43cc4bf81f4e6981
Author: Ariel Constenla-Haile <arielch@apache.org>
Date: Tue May 28 10:01:32 2013 +0000
Add missing copy&paste of SfxAppToolBoxControl_Impl::Select
(cherry picked from commit 47204c74d9e52f54f6983af19b66af2a96b42e61)
Conflicts:
framework/inc/uielement/popuptoolbarcontroller.hxx
svtools/inc/svtools/toolboxcontroller.hxx
The menu shown in the ui is a copy of a menu. The original menu has UserData
set on it which contains the target for the command, but the copy doesn't, so
looking up the target always fails and ses the "_default" frame and not the
correct "_self" required for the template menu
Change-Id: Ic1887467bf15f081d27286bd284929c17a2b19ad
Diffstat (limited to 'framework/source/uielement/newmenucontroller.cxx')
-rw-r--r-- | framework/source/uielement/newmenucontroller.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx index 3abad04ebee9..216c7a1c1762 100644 --- a/framework/source/uielement/newmenucontroller.cxx +++ b/framework/source/uielement/newmenucontroller.cxx @@ -85,7 +85,7 @@ void NewMenuController::setMenuImages( PopupMenu* pPopupMenu, bool bSetImages ) AddInfoForId::const_iterator pInfo = m_aAddInfoForItem.find( nItemId ); if ( pInfo != m_aAddInfoForItem.end() ) - aImageId = pInfo->second.aImageId; // Retrieve image id for menu item + aImageId = pInfo->second->aImageId; // Retrieve image id for menu item if ( !aImageId.isEmpty() ) { @@ -336,7 +336,6 @@ void NewMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopup *pVCLPopupMenu = *pSubMenu; Image aImage; - AddInfo aAddInfo; // retrieve additional parameters from bookmark menu and // store it in a unordered_map. @@ -349,10 +348,10 @@ void NewMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopup MenuConfiguration::Attributes* pBmkAttributes = reinterpret_cast<MenuConfiguration::Attributes *>(pSubMenu->GetUserValue( nItemId )); if ( pBmkAttributes != 0 ) { - aAddInfo.aTargetFrame = pBmkAttributes->aTargetFrame; - aAddInfo.aImageId = pBmkAttributes->aImageId; - - m_aAddInfoForItem.insert( AddInfoForId::value_type( nItemId, aAddInfo )); + auto result = m_aAddInfoForItem.insert( + std::make_pair(nItemId, std::unique_ptr<AddInfo>(new AddInfo(*pBmkAttributes)))); + MenuConfiguration::Attributes *pNewInfo = result.first->second.get(); + pVCLPopupMenu->SetUserValue(nItemId, reinterpret_cast<sal_uIntPtr>(pNewInfo)); } } } @@ -420,7 +419,7 @@ void SAL_CALL NewMenuController::itemSelected( const css::awt::MenuEvent& rEvent OUString aTargetFrame( m_aTargetFrame ); AddInfoForId::const_iterator pItem = m_aAddInfoForItem.find( rEvent.MenuId ); if ( pItem != m_aAddInfoForItem.end() ) - aTargetFrame = pItem->second.aTargetFrame; + aTargetFrame = pItem->second->aTargetFrame; xDispatch = xDispatchProvider->queryDispatch( aTargetURL, aTargetFrame, 0 ); } |