summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2017-02-03 13:34:44 +0200
committerMaxim Monastirsky <momonasmon@gmail.com>2017-02-05 18:19:29 +0200
commit1f9b7ccd6e988b330e5d16305c27c7d6844c938b (patch)
treed84cb692cf5c97aca4dfd69137246a0fce128500 /framework
parent47e84338e47c5a9c4cea6962b084aab6b2be94a4 (diff)
Restore custom tooltip support
This reverts the toolbarmanager.cxx part of 38839ae10cb565ff1977b1839de1c8278eac657b ("Remove the ability to set tooltips in the toolbar xml files"). It is true that tooltips can't be set in xml files, but toolbars can also be created/modified via the UIConfigurationManager and LayoutManager APIs, e.g. the test doc of i#105626 . Change-Id: Ida1559e61e7fd9bd6dcdd7b7159bc5efe070c721
Diffstat (limited to 'framework')
-rw-r--r--framework/source/uielement/toolbarmanager.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index 9542b49212b2..2ddc5f852804 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -984,6 +984,7 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine
Sequence< PropertyValue > aProp;
OUString aCommandURL;
OUString aLabel;
+ OUString aTooltip;
sal_uInt16 nType( css::ui::ItemType::DEFAULT );
sal_uInt32 nStyle( 0 );
@@ -1035,6 +1036,8 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine
}
else if ( aProp[i].Name == "Label" )
aProp[i].Value >>= aLabel;
+ else if ( aProp[i].Name == "Tooltip" )
+ aProp[i].Value >>= aTooltip;
else if ( aProp[i].Name == "Type" )
aProp[i].Value >>= nType;
else if ( aProp[i].Name == ITEM_DESCRIPTOR_VISIBLE )
@@ -1061,9 +1064,10 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine
}
m_pToolBar->InsertItem( nId, aString, nItemBits );
m_pToolBar->SetItemCommand( nId, aCommandURL );
- OUString sTooltip = vcl::CommandInfoProvider::Instance().GetTooltipForCommand(aCommandURL, m_xFrame);
- if (!sTooltip.isEmpty())
- m_pToolBar->SetQuickHelpText( nId, sTooltip );
+ if ( !aTooltip.isEmpty() )
+ m_pToolBar->SetQuickHelpText( nId, aTooltip );
+ else
+ m_pToolBar->SetQuickHelpText( nId, vcl::CommandInfoProvider::Instance().GetTooltipForCommand(aCommandURL, m_xFrame) );
if ( !aLabel.isEmpty() )
{