Kaydet (Commit) 1f9b7ccd authored tarafından Maxim Monastirsky's avatar Maxim Monastirsky

Restore custom tooltip support

This reverts the toolbarmanager.cxx part of
38839ae1 ("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
üst 47e84338
......@@ -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() )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment