summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej.hunt@collabora.com>2014-04-25 20:25:48 +0100
committerAndrzej Hunt <andrzej.hunt@collabora.com>2014-04-26 08:24:36 +0100
commit944c78ecb91608f4c3e9bab32fdbc90c67326525 (patch)
treecdce352a2c1e0a0dd45c1ef3036f1c8e5a3c9bfc /framework
parentc6c286f14468d341f5fd88edc39a37175a1b6caa (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
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 1b72a4f6d61c..13919fcbabf7 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -1905,6 +1905,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 );
@@ -1967,6 +1968,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;
}
}