From 499a34658e3a78d7b7c7c917eb739f8a1924c633 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Mon, 29 Feb 2016 17:46:30 +0100 Subject: tdf#98277 Extensions: Display shortcut in toolbar tooltip (cherry picked from commits 3ff17bda5ba3e627e9b996506dc72b68cf67483b and 398fadca9a82917ed865e328ba454d8015803b66) Change-Id: Icc16860d8b47a3724838fdb3dcb72dfb4398167d Reviewed-on: https://gerrit.libreoffice.org/22805 Tested-by: Jenkins Reviewed-by: Katarina Behrens --- framework/source/uielement/addonstoolbarmanager.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/framework/source/uielement/addonstoolbarmanager.cxx b/framework/source/uielement/addonstoolbarmanager.cxx index 7804108f72df..5e57cd286e6e 100644 --- a/framework/source/uielement/addonstoolbarmanager.cxx +++ b/framework/source/uielement/addonstoolbarmanager.cxx @@ -56,6 +56,7 @@ #include #include #include +#include // namespaces @@ -257,6 +258,10 @@ void AddonsToolBarManager::FillToolbar( const Sequence< Sequence< PropertyValue m_pToolBar->InsertItem( nId, aTitle ); + OUString aShortcut(vcl::CommandInfoProvider::Instance().GetCommandShortcut(aURL, m_xFrame)); + if (!aShortcut.isEmpty()) + m_pToolBar->SetQuickHelpText(nId, aTitle + " (" + aShortcut + ")"); + // don't setup images yet, AddonsToolbarWrapper::populateImages does that. // Create TbRuntimeItemData to hold additional information we will need in the future -- cgit