From 6bbb384bf6334eb9f207f4098820e6852e21325a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 9 Jan 2019 13:05:16 +0000 Subject: Resolves: tdf#122348 make return in spinbutton signal value change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit before going on to close the dialog afterwards Change-Id: I9764512a944e52b0d2bff2d11c8cf74c057e2623 Reviewed-on: https://gerrit.libreoffice.org/66024 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- vcl/source/app/salvtables.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'vcl/source') diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 813154ba465f..34c86b8fe960 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -2576,6 +2576,7 @@ private: DECL_LINK(LoseFocusHdl, Control&, void); DECL_LINK(OutputHdl, Edit&, bool); DECL_LINK(InputHdl, sal_Int64*, TriState); + DECL_LINK(ActivateHdl, Edit&, bool); double toField(int nValue) const { @@ -2598,6 +2599,7 @@ public: m_xButton->SetLoseFocusHdl(LINK(this, SalInstanceSpinButton, LoseFocusHdl)); m_xButton->SetOutputHdl(LINK(this, SalInstanceSpinButton, OutputHdl)); m_xButton->SetInputHdl(LINK(this, SalInstanceSpinButton, InputHdl)); + m_xButton->GetSubEdit()->SetActivateHdl(LINK(this, SalInstanceSpinButton, ActivateHdl)); } virtual int get_value() const override @@ -2657,6 +2659,8 @@ public: virtual ~SalInstanceSpinButton() override { + if (Edit* pEdit = m_xButton->GetSubEdit()) + pEdit->SetActivateHdl(Link()); m_xButton->SetInputHdl(Link()); m_xButton->SetOutputHdl(Link()); m_xButton->SetLoseFocusHdl(Link()); @@ -2665,6 +2669,13 @@ public: } }; +IMPL_LINK_NOARG(SalInstanceSpinButton, ActivateHdl, Edit&, bool) +{ + // tdf#122348 return pressed to end dialog + signal_value_changed(); + return false; +} + IMPL_LINK_NOARG(SalInstanceSpinButton, UpDownHdl, SpinField&, void) { signal_value_changed(); -- cgit