[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - vcl/jsdialog
Szymon KÅos (via logerrit)
logerrit at kemper.freedesktop.org
Wed May 26 08:19:41 UTC 2021
vcl/jsdialog/executor.cxx | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 72211a4618bddc82c2adcb17b11db98039e8cf11
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed May 26 10:06:35 2021 +0200
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed May 26 10:18:54 2021 +0200
jsdialog: allow fraction numbers in spinfield
Change-Id: I9849c6a798f0ade60606be75125fde98362d26b1
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index d40a663474ad..288ce5703d62 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -177,9 +177,13 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat
{
if (sAction == "change" || sAction == "value")
{
+ if (rData["data"] == "undefined")
+ return true;
+
OString sValue = OUStringToOString(rData["data"], RTL_TEXTENCODING_ASCII_US);
- int nValue = std::atoi(sValue.getStr());
- pSpinField->set_value(pSpinField->normalize(nValue));
+ double nValue = std::atof(sValue.getStr());
+ pSpinField->set_value(nValue
+ * weld::SpinButton::Power10(pSpinField->get_digits()));
LOKTrigger::trigger_value_changed(*pSpinField);
return true;
}
More information about the Libreoffice-commits
mailing list