summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-05-22 21:13:38 +0200
committerEike Rathke <erack@redhat.com>2017-05-22 21:14:16 +0200
commit6b417ec3daaec72c736fcfe0d980ce205e589633 (patch)
tree84cd3b514009e272ab5b2813e11970d21c74e63e
parent8b55956d6a07d1d6b62ffdf58277e6752513f4c0 (diff)
Handle SUMPRODUCT with svRefList arguments, tdf#58874
Change-Id: I03c2ed1f957db5ad8a67aaab45076373a020e9c1
-rw-r--r--sc/source/core/tool/interpr5.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx
index 4e0ee214897c..3d994f4852ea 100644
--- a/sc/source/core/tool/interpr5.cxx
+++ b/sc/source/core/tool/interpr5.cxx
@@ -1690,28 +1690,30 @@ public:
void ScInterpreter::ScSumProduct()
{
- sal_uInt8 nParamCount = GetByte();
+ short nParamCount = GetByte();
if ( !MustHaveParamCount( nParamCount, 1, 30 ) )
return;
ScMatrixRef pMatLast;
ScMatrixRef pMat;
+ size_t nRefInList = 0;
- pMatLast = GetMatrix();
+ pMatLast = GetMatrix( nParamCount, nRefInList);
if (!pMatLast)
{
PushIllegalParameter();
return;
}
+ --nParamCount;
SCSIZE nC, nCLast, nR, nRLast;
pMatLast->GetDimensions(nCLast, nRLast);
std::vector<double> aResArray;
pMatLast->GetDoubleArray(aResArray);
- for (sal_uInt16 i = 1; i < nParamCount; ++i)
+ while (nParamCount--)
{
- pMat = GetMatrix();
+ pMat = GetMatrix( nParamCount, nRefInList);
if (!pMat)
{
PushIllegalParameter();