From db106346a9797565e406cf9c26e762327446f59a Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Mon, 22 Aug 2022 18:27:27 +0200 Subject: jsdialog: send action not update for spin button value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will help us to reduce payload and fix bug where in Chrome regenerated spin field always focused "arrow down" button after click on the "arrow up". Use value from formatter - the same as generated in widget update JSON. Change-Id: I6ace90eb532e894daacb563bc9fb93332fd755ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138700 Tested-by: Jenkins CollaboraOffice Reviewed-by: Rashesh Padia Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140579 Tested-by: Jenkins --- vcl/jsdialog/jsdialogbuilder.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'vcl/jsdialog/jsdialogbuilder.cxx') diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index 662caaf6a9f2..da30834b0568 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -1368,7 +1368,11 @@ JSSpinButton::JSSpinButton(JSDialogSender* pSender, ::FormattedField* pSpin, void JSSpinButton::set_value(sal_Int64 value) { SalInstanceSpinButton::set_value(value); - sendUpdate(true); // if input is limited we can receive the same JSON + + std::unique_ptr pMap = std::make_unique(); + (*pMap)[ACTION_TYPE] = "setText"; + (*pMap)["text"] = OUString::number(m_rFormatter.GetValue()); + sendAction(std::move(pMap)); } JSMessageDialog::JSMessageDialog(JSDialogSender* pSender, ::MessageDialog* pDialog, -- cgit