diff options
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() ) { |