summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-05-22 16:20:59 +0200
committerEike Rathke <erack@redhat.com>2017-05-22 16:23:49 +0200
commit44b56bab060b3268617ed930fb783a20e617d137 (patch)
tree5c8366fb848f8bcf3b1424318b226188468dfb66
parentcd71e5b97fb8042df8770470ffa75fd5227ad5e6 (diff)
Get vector count right, tdf#58874
Change-Id: I1d4224c6a87af4ed9f879e144958f95418fabbf7
-rw-r--r--sc/source/core/tool/interpr6.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/sc/source/core/tool/interpr6.cxx b/sc/source/core/tool/interpr6.cxx
index 35004f2846bc..6e614098e4a7 100644
--- a/sc/source/core/tool/interpr6.cxx
+++ b/sc/source/core/tool/interpr6.cxx
@@ -997,14 +997,13 @@ void ScInterpreter::IterateParameters( ScIterFunc eFunc, bool bTextAsZero )
// Include value of last non-references-array type and calculate final result.
for (SCSIZE i=0; i < nMatRows; ++i)
{
- if (xResCount)
- nCount += xResCount->GetDouble(0,i);
+ sal_uLong nVecCount = (xResCount ? nCount + xResCount->GetDouble(0,i) : nCount);
double fVecRes = xResMat->GetDouble(0,i);
if (eFunc == ifPRODUCT)
fVecRes *= fRes;
else
fVecRes += fRes;
- fVecRes = lcl_IterResult( eFunc, fVecRes, fMem, nCount);
+ fVecRes = lcl_IterResult( eFunc, fVecRes, fMem, nVecCount);
xResMat->PutDouble( fVecRes, 0,i);
}
PushMatrix( xResMat);