[Libreoffice-commits] core.git: framework/source

Samuel Mehrbrodt s.mehrbrodt at gmail.com
Mon Sep 22 14:24:15 PDT 2014


 framework/source/uielement/toolbarmanager.cxx |   23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

New commits:
commit fb1be6943fa11f1680c9fa69ba56bdcfad64850e
Author: Samuel Mehrbrodt <s.mehrbrodt at gmail.com>
Date:   Mon Sep 22 21:59:58 2014 +0200

    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 at gmail.com>
    Tested-by: Samuel Mehrbrodt <s.mehrbrodt at gmail.com>

diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index 39ecdb2..74d66a4 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() )
                     {


More information about the Libreoffice-commits mailing list