summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-02-29 17:46:30 +0100
committerKatarina Behrens <Katarina.Behrens@cib.de>2016-03-02 10:04:41 +0000
commit499a34658e3a78d7b7c7c917eb739f8a1924c633 (patch)
tree42bd80ae412dbcb9012e72abe89247abc2b70d69
parentImprove the import of pen styles from EMF files (diff)
downloadcore-499a34658e3a78d7b7c7c917eb739f8a1924c633.tar.gz
core-499a34658e3a78d7b7c7c917eb739f8a1924c633.zip
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 <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
-rw-r--r--framework/source/uielement/addonstoolbarmanager.cxx5
1 files changed, 5 insertions, 0 deletions
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 <vcl/taskpanelist.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/settings.hxx>
+#include <vcl/commandinfoprovider.hxx>
// 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