[Libreoffice-commits] core.git: 2 commits - vcl/jsdialog
Szymon KÅos (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jul 19 11:55:01 UTC 2021
vcl/jsdialog/executor.cxx | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 9bd487c43e72186d3d9023d5fa90da0398811947
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: Mon Jul 19 13:54:43 2021 +0200
jsdialog: allow fraction numbers in spinfield
Change-Id: I9849c6a798f0ade60606be75125fde98362d26b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119162
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index 61809d72c358..d35ae301be66 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -176,9 +176,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;
}
commit c3158c6a11fa1d79bce36789768f6811a5a82623
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed May 26 09:53:05 2021 +0200
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Mon Jul 19 13:54:28 2021 +0200
jsdialog: normalize value for spinfield
Change-Id: Ia65b1342222952cbec1ddfba4b7464172fd2b40c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119161
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index c979230e7f31..61809d72c358 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -178,7 +178,7 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat
{
OString sValue = OUStringToOString(rData["data"], RTL_TEXTENCODING_ASCII_US);
int nValue = std::atoi(sValue.getStr());
- pSpinField->set_value(nValue);
+ pSpinField->set_value(pSpinField->normalize(nValue));
LOKTrigger::trigger_value_changed(*pSpinField);
return true;
}
More information about the Libreoffice-commits
mailing list