diff options
author | Tor Lillqvist <tml@collabora.com> | 2015-10-14 21:14:04 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2015-10-15 13:45:44 +0300 |
commit | bdef079b39d273d2985d360a52597672c96b43fc (patch) | |
tree | 27c17e5536b31801469de18942a59914502c9428 | |
parent | e5155848e41dfa528b91f068358e0b613b713979 (diff) |
tdf#94924: Fix handling of empty cells in OpenCL subtraction
We get correct result by simplifying the code;)
No need to have the outer "if (gid0 < X)" test around the calculation
code generated by Reduction::GenSlidingWindowFunction(). The lhs and
rhs check the gid0 range themselves and that leads to the desired
result for subtraction.
While fixing this I noticed that the handling of empty cells in
division is also wrong. Will fix in another commit.
Change-Id: Ia45bd81e692a17b0453cc79cd4673a00e119562a
-rw-r--r-- | sc/source/core/opencl/formulagroupcl.cxx | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index 50190ad16277..4c56d03fdf18 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -1732,13 +1732,8 @@ public: assert(pCur); assert(pCur->GetType() != formula::svDoubleVectorRef); - if (pCur->GetType() == formula::svSingleVectorRef) - { - const formula::SingleVectorRefToken* pSVR = - static_cast<const formula::SingleVectorRefToken*>(pCur); - ss << "if (gid0 < " << pSVR->GetArrayLength() << "){\n"; - } - else if (pCur->GetType() == formula::svDouble) + if (pCur->GetType() == formula::svSingleVectorRef || + pCur->GetType() == formula::svDouble) { ss << "{\n"; } |