diff options
author | Samuel Mehrbrodt <s.mehrbrodt@gmail.com> | 2014-09-22 21:59:58 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <s.mehrbrodt@gmail.com> | 2014-09-22 21:23:46 +0000 |
commit | fb1be6943fa11f1680c9fa69ba56bdcfad64850e (patch) | |
tree | 69f9be1b756ff34b082c6600a95792a426e987ee /framework/source/uielement | |
parent | 2897374fdad4fdb2daab273c2cf6f85e5ae49ec1 (diff) |
Always add the keyboard shortcut to the toolbar tooltips
Change-Id: I6f6e385cf6d09b0a3f18b708daeff2df9aba83c6
Reviewed-on: https://gerrit.libreoffice.org/11595
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Diffstat (limited to 'framework/source/uielement')
-rw-r--r-- | framework/source/uielement/toolbarmanager.cxx | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index 39ecdb22c388..74d66a4df3aa 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -1276,23 +1276,18 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine } m_pToolBar->InsertItem( nId, aString, nItemBits ); m_pToolBar->SetItemCommand( nId, aCommandURL ); + OUString sQuickHelp( aString ); + // Use custom tooltip if available if ( !aTooltip.isEmpty() ) + sQuickHelp = aTooltip; + OUString sShortCut; + if( RetrieveShortcut( aCommandURL, sShortCut ) ) { - m_pToolBar->SetQuickHelpText( nId, aTooltip ); - } - else - { - OUString sQuickHelp( aString ); - OUString sShortCut; - if( RetrieveShortcut( aCommandURL, sShortCut ) ) - { - sQuickHelp += " ("; - sQuickHelp += sShortCut; - sQuickHelp += ")"; - } - - m_pToolBar->SetQuickHelpText( nId, sQuickHelp ); + sQuickHelp += " ("; + sQuickHelp += sShortCut; + sQuickHelp += ")"; } + m_pToolBar->SetQuickHelpText( nId, sQuickHelp ); if ( !aLabel.isEmpty() ) { |