[Libreoffice-commits] core.git: sc/source
Tor Lillqvist
tml at collabora.com
Mon Feb 8 06:38:49 UTC 2016
sc/source/core/tool/scmatrix.cxx | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
New commits:
commit a86f46ec138e0215c6c82200ab5aea35fdb217b2
Author: Tor Lillqvist <tml at collabora.com>
Date: Fri Feb 5 15:01:48 2016 +0200
tdf#97369: Fix SUMming in the software interpreter
GetRefRowSize() is not what we want, but GetArrayLength(). I think. At
least helps in the sample document. (Need a hard recalc after loading
it, though, but I assume that is expected.)
Also, fix the handling of multiple columns in the area being summed.
Change-Id: I21477ca83042a40a300bc033e4a8b74ab5fc3015
Reviewed-on: https://gerrit.libreoffice.org/22153
Reviewed-by: Tor Lillqvist <tml at collabora.com>
Tested-by: Tor Lillqvist <tml at collabora.com>
diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index a3a86d4..33879bc 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -3398,13 +3398,13 @@ ScMatrix::IterateResult ScVectorRefMatrix::Sum(bool bTextAsZero) const
const std::vector<formula::VectorRefArray>& rArrays = mpToken->GetArrays();
size_t nDataSize = mnRowSize;
- if (mnRowStart >= mpToken->GetRefRowSize())
+ if (mnRowStart >= mpToken->GetArrayLength())
{
return ScMatrix::IterateResult(0.0, 0.0, 0);
}
- else if (nDataSize > mpToken->GetRefRowSize() + mnRowStart)
+ else if (nDataSize > mpToken->GetArrayLength() + mnRowStart)
{
- nDataSize = mpToken->GetRefRowSize() - mnRowStart;
+ nDataSize = mpToken->GetArrayLength() - mnRowStart;
}
double mfFirst = 0.0;
@@ -3435,11 +3435,10 @@ ScMatrix::IterateResult ScVectorRefMatrix::Sum(bool bTextAsZero) const
}
}
p += i;
- nDataSize -= i;
- if (nDataSize == 0)
+ if (i == nDataSize)
continue;
- sc::ArraySumFunctor functor(p, nDataSize);
+ sc::ArraySumFunctor functor(p, nDataSize-i);
mfRest += functor();
}
More information about the Libreoffice-commits
mailing list