summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej.hunt@collabora.com>2014-04-25 20:25:48 +0100
committerAndras Timar <andras.timar@collabora.com>2014-04-30 14:56:58 +0200
commit78f45f6b9d90c9737ca6d0ad10717ffadf1e31f3 (patch)
treeb77d56e3506155f0d563d193c16f0bb880c6b126 /framework
parentbfbe520e5f02558be0aadf534d300decf3169de0 (diff)
fdo#75489 Pass toolbar context menu commands to toolbar for handling.
The toolbar context menu is handled by the toolbar manager, however the items are provided and managed by the toolbar itself -- previously any events on the list of toolbar items in the context menu were silently discarded, whereas now we pass them on to the owning toolbar. Change-Id: Ia17718c3ff8acfba1b6d655022dd9469932f3493 (cherry picked from commit 944c78ecb91608f4c3e9bab32fdbc90c67326525) Reviewed-on: https://gerrit.libreoffice.org/9170 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/uielement/toolbarmanager.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index 3a2617b6dd64..288f20dbd290 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -1914,6 +1914,7 @@ IMPL_LINK( ToolBarManager, MenuSelect, Menu*, pMenu )
{
sal_uInt16 nId = pMenu->GetCurItemId();
if(( nId > 0 ) && ( nId < TOOLBOX_MENUITEM_START ))
+ // Items in the "enable/disable" sub-menu
{
// toggle toolbar button visibility
OUString aCommand = pMenu->GetItemCommand( nId );
@@ -1976,6 +1977,14 @@ IMPL_LINK( ToolBarManager, MenuSelect, Menu*, pMenu )
}
}
}
+ else
+ // The list of "hidden items", i.e. items which are disabled on
+ // the toolbar hence shown in the context menu for easier access,
+ // which are managed by the owning toolbar.
+ {
+ m_pToolBar->TriggerItem( pMenu->GetCurItemId()
+ - TOOLBOX_MENUITEM_START );
+ }
break;
}
}