svx/source/tbxctrls/grafctrl.cxx |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

New commits:
commit 1301b26b28b3d85bb6f5cd1dad53da1580f873ff
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed May 11 15:18:20 2022 +0100
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Thu May 12 12:37:04 2022 +0200

    tdf#149023 set property immediately on change
    
    and not in an idle which may be triggered on losing focus and
    arrive when a new shape is selected
    
    Change-Id: I7cec8f1c9bf864cdb30516dece1ef9d6b689a94e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134175
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx
index 02fb3d540ba8..a88ececfa7dd 100644
--- a/svx/source/tbxctrls/grafctrl.cxx
+++ b/svx/source/tbxctrls/grafctrl.cxx
@@ -71,7 +71,6 @@ namespace {
 class ImplGrafControl final : public InterimItemWindow
 {
 private:
-    Idle maIdle;
     OUString maCommand;
     Reference<XFrame> mxFrame;
     std::unique_ptr<weld::Image> mxImage;
@@ -79,7 +78,7 @@ private:
 
     DECL_LINK(ValueChangedHdl, weld::MetricSpinButton&, void);
     DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
-    DECL_LINK(ImplModifyHdl, Timer*, void);
+    void ImplModify();
 
 public:
     ImplGrafControl( vcl::Window* pParent, const OUString& rCmd, const 
Reference< XFrame >& rFrame );
@@ -100,10 +99,10 @@ public:
 
 IMPL_LINK_NOARG(ImplGrafControl, ValueChangedHdl, weld::MetricSpinButton&, 
void)
 {
-    maIdle.Start();
+    ImplModify();
 }
 
-IMPL_LINK_NOARG(ImplGrafControl, ImplModifyHdl, Timer*, void)
+void ImplGrafControl::ImplModify()
 {
     const sal_Int64 nVal = mxField->get_value(FieldUnit::NONE);
 
@@ -196,7 +195,6 @@ ImplGrafControl::ImplGrafControl(
     const OUString& rCmd,
     const Reference< XFrame >& rFrame)
     : InterimItemWindow(pParent, "svx/ui/grafctrlbox.ui", "GrafCtrlBox")
-    , maIdle("svx ImplGrafControl maIdle")
     , maCommand(rCmd)
     , mxFrame(rFrame)
     , mxImage(m_xBuilder->weld_image("image"))
@@ -232,8 +230,6 @@ ImplGrafControl::ImplGrafControl(
         mxField->set_increments(1, 10, FieldUnit::PERCENT);
     }
 
-    maIdle.SetInvokeHandler( LINK( this, ImplGrafControl, ImplModifyHdl ) );
-
     SetSizePixel(m_xContainer->get_preferred_size());
 }
 

Reply via email to