diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/opencl/op_statistical.cxx | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/sc/source/core/opencl/op_statistical.cxx b/sc/source/core/opencl/op_statistical.cxx index 5278ad2b31f7..d18b3ffceec1 100644 --- a/sc/source/core/opencl/op_statistical.cxx +++ b/sc/source/core/opencl/op_statistical.cxx @@ -2548,6 +2548,7 @@ void OpStDevP::GenSlidingWindowFunction(std::stringstream &ss, void OpSlope::GenSlidingWindowFunction(std::stringstream &ss, const std::string &sSymName, SubArguments &vSubArguments) { + CHECK_PARAMETER_COUNT(2,2); ss << "\ndouble " << sSymName; ss << "_" << BinFuncName() << "("; for (size_t i = 0; i < vSubArguments.size(); i++) @@ -2567,12 +2568,6 @@ void OpSlope::GenSlidingWindowFunction(std::stringstream &ss, ss << " double fCount = 0.0;\n"; ss << " double argX = 0.0;\n"; ss << " double argY = 0.0;\n"; - if(vSubArguments.size() != 2) - { - ss << " return NAN;\n"; - ss << "}\n"; - return ; - } FormulaToken *pCur = vSubArguments[1]->GetFormulaToken(); FormulaToken *pCur1 = vSubArguments[0]->GetFormulaToken(); assert(pCur); @@ -2591,11 +2586,7 @@ void OpSlope::GenSlidingWindowFunction(std::stringstream &ss, pDVR1->GetArrayLength() ? pDVR->GetArrayLength(): pDVR1->GetArrayLength(); if(nCurWindowSize != nCurWindowSize1) - { - ss << " return NAN;\n"; - ss << "}\n"; - return ; - } + throw Unhandled(__FILE__, __LINE__); ss << " for (int i = "; if ((!pDVR->IsStartFixed() && pDVR->IsEndFixed()) &&(!pDVR1->IsStartFixed() && pDVR1->IsEndFixed())) @@ -2626,13 +2617,7 @@ void OpSlope::GenSlidingWindowFunction(std::stringstream &ss, } else { - ss << "0; i < " << nCurWindowSize << "; i++)\n"; - ss << " {\n"; - ss << " break;\n"; - ss << " }"; - ss << " return NAN;\n"; - ss << "}\n"; - return ; + throw Unhandled(__FILE__, __LINE__); } ss << " argX = "; @@ -2701,8 +2686,7 @@ void OpSlope::GenSlidingWindowFunction(std::stringstream &ss, } else { - ss << " return NAN;\n"; - ss << "}\n"; + throw Unhandled(__FILE__, __LINE__); } } void OpSTEYX::GenSlidingWindowFunction(std::stringstream &ss, |