vcl/inc/jsdialog/jsdialogbuilder.hxx | 3 +++ vcl/jsdialog/jsdialogbuilder.cxx | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-)
New commits: commit 6833ad8100155697363911a3357f317c1c68dd0e Author: Dennis Francis <[email protected]> AuthorDate: Fri Oct 31 16:38:55 2025 +0530 Commit: Tomaž Vajngerl <[email protected]> CommitDate: Tue Nov 4 09:42:10 2025 +0100 lok: formatted-spin-button is ignoring input Calling Edit::SetText() via SalInstanceFormattedSpinButton::set_text() on a FormattedField does not parse and store the value using its formatter at least in the jsdialog case. Signed-off-by: Dennis Francis <[email protected]> Change-Id: Ia20ba0f260a6c5e78b19dff328899d974658de94 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193260 Reviewed-by: Tomaž Vajngerl <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx index bd733f2a4669..29930748f213 100644 --- a/vcl/inc/jsdialog/jsdialogbuilder.hxx +++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx @@ -620,6 +620,9 @@ public: virtual void set_text(const OUString& rText) override; void set_text_without_notify(const OUString& rText); + +private: + VclPtr<::FormattedField> m_pFmtSpin; }; class JSMessageDialog final : public JSWidget<SalInstanceMessageDialog, ::MessageDialog> diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index a7ac443bf561..e31e1c34247b 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -1403,12 +1403,19 @@ JSFormattedSpinButton::JSFormattedSpinButton(JSDialogSender* pSender, ::Formatte SalInstanceBuilder* pBuilder, bool bTakeOwnership) : JSWidget<SalInstanceFormattedSpinButton, ::FormattedField>(pSender, pSpin, pBuilder, bTakeOwnership) + , m_pFmtSpin(pSpin) { } void JSFormattedSpinButton::set_text(const OUString& rText) { - SalInstanceFormattedSpinButton::set_text(rText); + if (!m_pFmtSpin) + return; + + disable_notify_events(); + m_pFmtSpin->SetValueFromString(rText); + enable_notify_events(); + sendUpdate(); }
