summaryrefslogtreecommitdiff
path: root/framework/source/uielement/popuptoolbarcontroller.cxx
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2016-01-18 01:10:21 +0200
committerMaxim Monastirsky <momonasmon@gmail.com>2016-01-18 01:20:49 +0200
commit69882b0ef861099fd6bfa802d6f7ba5d1391c269 (patch)
tree8ea9116603255349926bbf7bceeed13903baaa6c /framework/source/uielement/popuptoolbarcontroller.cxx
parent734cadff24b3e8555b40c58b4abd1f1c366c25cb (diff)
Don't update the save icon on every keystroke
Change-Id: Iad6195ea8b082ca5e6c1a7e9fa48742ff2b495a6
Diffstat (limited to 'framework/source/uielement/popuptoolbarcontroller.cxx')
-rw-r--r--framework/source/uielement/popuptoolbarcontroller.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx
index d2c272bdd158..f7643b460fe0 100644
--- a/framework/source/uielement/popuptoolbarcontroller.cxx
+++ b/framework/source/uielement/popuptoolbarcontroller.cxx
@@ -349,11 +349,13 @@ public:
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw ( css::uno::RuntimeException ) override;
private:
+ bool m_bModified;
css::uno::Reference< css::util::XModifiable > m_xModifiable;
};
SaveToolbarController::SaveToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext )
: ImplInheritanceHelper( rxContext, ".uno:SaveAsMenu" )
+ , m_bModified( false )
{
}
@@ -417,7 +419,7 @@ void SaveToolbarController::updateImage()
{
aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand( ".uno:SaveAs", bLargeIcons, m_xFrame );
}
- else if ( m_xModifiable.is() && m_xModifiable->isModified() )
+ else if ( m_bModified )
{
Image aResImage( bLargeIcons ? FwkResId( IMG_SAVEMODIFIED_LARGE ) : FwkResId( IMG_SAVEMODIFIED_SMALL ) );
aImage = aResImage;
@@ -459,7 +461,12 @@ void SaveToolbarController::statusChanged( const css::frame::FeatureStateEvent&
void SaveToolbarController::modified( const css::lang::EventObject& /*rEvent*/ )
throw ( css::uno::RuntimeException, std::exception )
{
- updateImage();
+ bool bModified = m_xModifiable->isModified();
+ if ( bModified != m_bModified )
+ {
+ m_bModified = bModified;
+ updateImage();
+ }
}
void SaveToolbarController::disposing( const css::lang::EventObject& rEvent )