summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2016-04-13 00:29:00 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2016-04-13 02:18:27 +0300
commit9ced1d7f5aa8ba728a62ae403f126dd6c35b8923 (patch)
tree7bf56166c469eb16f4232f6f38f9a91272359f77
parentfd4ca5523a0e92c1531faacc3c38b936c1af31f9 (diff)
Tooltip/bits should also depend on state change
Change-Id: I18093e42dd2fc54483e620759e4ba00c988ce9db
-rw-r--r--framework/source/uielement/popuptoolbarcontroller.cxx13
1 files changed, 5 insertions, 8 deletions
diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx
index e15675267a40..de5143bdfb8e 100644
--- a/framework/source/uielement/popuptoolbarcontroller.cxx
+++ b/framework/source/uielement/popuptoolbarcontroller.cxx
@@ -461,20 +461,17 @@ void SaveToolbarController::statusChanged( const css::frame::FeatureStateEvent&
if ( !getToolboxId( nId, &pToolBox ) )
return;
- if ( m_bSaveAsModeAllowed )
+ if ( !m_bSaveAsModeAllowed )
+ pToolBox->EnableItem( nId, rEvent.IsEnabled );
+ else if ( m_bSaveAsModeActive == bool( rEvent.IsEnabled ) )
{
+ m_bSaveAsModeActive = !m_bSaveAsModeActive;
pToolBox->SetQuickHelpText( nId,
vcl::CommandInfoProvider::Instance().GetTooltipForCommand( rEvent.IsEnabled ? m_aCommandURL : OUString( ".uno:SaveAs" ), m_xFrame ) );
pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) & ~( rEvent.IsEnabled ? ToolBoxItemBits::DROPDOWNONLY : ToolBoxItemBits::DROPDOWN ) );
pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | ( rEvent.IsEnabled ? ToolBoxItemBits::DROPDOWN : ToolBoxItemBits::DROPDOWNONLY ) );
- if ( m_bSaveAsModeActive == bool( rEvent.IsEnabled ) )
- {
- m_bSaveAsModeActive = !rEvent.IsEnabled;
- updateImage();
- }
+ updateImage();
}
- else
- pToolBox->EnableItem( nId, rEvent.IsEnabled );
}
void SaveToolbarController::modified( const css::lang::EventObject& /*rEvent*/ )