summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej.hunt@collabora.com>2014-04-25 20:25:48 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-04-28 12:08:15 +0000
commit9e3d6ec6e5333bf1fa4bd151a9897dad20d11a14 (patch)
tree630b33b593f53f5e7ec4e3242f3477c24cd679fb /framework
parent0b6fe077679e33ed91bf81796fe454cc75730916 (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;
}
}