[Libreoffice-commits] core.git: sc/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Dec 5 10:00:27 UTC 2018
sc/source/core/opencl/op_math.cxx | 5 +++++
1 file changed, 5 insertions(+)
New commits:
commit 79ed7bbacae43468b690a3d3a6b1acf31e641cee
Author: Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Tue Dec 4 12:44:40 2018 +0100
Commit: Luboš Luňák <l.lunak at collabora.com>
CommitDate: Wed Dec 5 10:59:59 2018 +0100
fix OpenCL ROUND() when the second parameter is negative
Change-Id: Ibbf374f72e83609a602504d9ffde922896338c2c
Reviewed-on: https://gerrit.libreoffice.org/64543
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak at collabora.com>
diff --git a/sc/source/core/opencl/op_math.cxx b/sc/source/core/opencl/op_math.cxx
index a9216f72b3e7..224c6480c3b5 100644
--- a/sc/source/core/opencl/op_math.cxx
+++ b/sc/source/core/opencl/op_math.cxx
@@ -1610,6 +1610,7 @@ void OpLn::GenSlidingWindowFunction(
void OpRound::GenSlidingWindowFunction(std::stringstream &ss,
const std::string &sSymName, SubArguments &vSubArguments)
{
+ CHECK_PARAMETER_COUNT( 1, 2 );
ss << "\ndouble " << sSymName;
ss << "_"<< BinFuncName() <<"(";
for (size_t i = 0; i < vSubArguments.size(); i++)
@@ -1627,12 +1628,16 @@ void OpRound::GenSlidingWindowFunction(std::stringstream &ss,
{
ss << " for(int i=0;i<tmp1;i++)\n";
ss << " tmp0 = tmp0 * 10;\n";
+ ss << " for(int i=0;i>tmp1;i--)\n";
+ ss << " tmp0 = tmp0 / 10;\n";
}
ss << " double tmp=round(tmp0);\n";
if(vSubArguments.size() ==2)
{
ss << " for(int i=0;i<tmp1;i++)\n";
ss << " tmp = tmp / 10;\n";
+ ss << " for(int i=0;i>tmp1;i--)\n";
+ ss << " tmp = tmp * 10;\n";
}
ss << " return tmp;\n";
ss << "}";
More information about the Libreoffice-commits
mailing list