[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - framework/source

Maxim Monastirsky momonasmon at gmail.com
Fri Jan 22 05:24:05 PST 2016


 framework/source/uielement/popuptoolbarcontroller.cxx |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 70e08ce45ae06abdd978430263c8ef5d6a8826e2
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Mon Jan 18 01:10:21 2016 +0200

    Don't update the save icon on every keystroke
    
    Change-Id: Iad6195ea8b082ca5e6c1a7e9fa48742ff2b495a6
    (cherry picked from commit 69882b0ef861099fd6bfa802d6f7ba5d1391c269)
    Reviewed-on: https://gerrit.libreoffice.org/21701
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx
index 0464368..6b9c552 100644
--- a/framework/source/uielement/popuptoolbarcontroller.cxx
+++ b/framework/source/uielement/popuptoolbarcontroller.cxx
@@ -345,11 +345,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 )
 {
 }
 
@@ -413,7 +415,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;
@@ -455,7 +457,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 )


More information about the Libreoffice-commits mailing list