summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-08-11 13:25:09 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-08-12 21:05:09 +0200
commitbb6f2b12e8f0bbc99a5ca93141d35fd40b043e55 (patch)
tree839679f895852b2a13ba6c69325b1725ee4860f2 /sc
parentd42d937e6edb85bb8c2795cd54dc237e0da49bd6 (diff)
loplugin:constantparam
Change-Id: I676a8408e97cc8134009f764736cad68513c89ad Reviewed-on: https://gerrit.libreoffice.org/58875 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/scmatrix.hxx4
-rw-r--r--sc/source/core/tool/interpr3.cxx4
-rw-r--r--sc/source/core/tool/scmatrix.cxx18
3 files changed, 11 insertions, 15 deletions
diff --git a/sc/inc/scmatrix.hxx b/sc/inc/scmatrix.hxx
index b681fc2d0c23..c7e50fe408ab 100644
--- a/sc/inc/scmatrix.hxx
+++ b/sc/inc/scmatrix.hxx
@@ -396,7 +396,7 @@ public:
virtual void DivOp(bool bFlag, double fVal, ScMatrix& rMat) = 0;
virtual void PowOp(bool bFlag, double fVal, ScMatrix& rMat) = 0;
- virtual std::vector<ScMatrix::IterateResult> Collect(bool bTextAsZero, const std::vector<std::unique_ptr<sc::op::Op>>& aOp) = 0;
+ virtual std::vector<ScMatrix::IterateResult> Collect(const std::vector<std::unique_ptr<sc::op::Op>>& aOp) = 0;
virtual void ExecuteOperation(const std::pair<size_t, size_t>& rStartPos, const std::pair<size_t, size_t>& rEndPos,
DoubleOpFunction aDoubleFunc, BoolOpFunction aBoolFunc, StringOpFunction aStringFunc,
@@ -614,7 +614,7 @@ public:
virtual void DivOp(bool bFlag, double fVal, ScMatrix& rMat) override;
virtual void PowOp(bool bFlag, double fVal, ScMatrix& rMat) override;
- virtual std::vector<ScMatrix::IterateResult> Collect(bool bTextAsZero, const std::vector<std::unique_ptr<sc::op::Op>>& aOp) override;
+ virtual std::vector<ScMatrix::IterateResult> Collect(const std::vector<std::unique_ptr<sc::op::Op>>& aOp) override;
virtual void ExecuteOperation(const std::pair<size_t, size_t>& rStartPos, const std::pair<size_t, size_t>& rEndPos,
DoubleOpFunction aDoubleFunc, BoolOpFunction aBoolFunc, StringOpFunction aStringFunc,
diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index 689ea4e4de59..7c46264f83e0 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -2744,12 +2744,12 @@ void ScInterpreter::ScFTest()
aOp.emplace_back(new sc::op::Op(0.0, [](double& rAccum, double fVal){rAccum += fVal;}));
aOp.emplace_back(new sc::op::Op(0.0, [](double& rAccum, double fVal){rAccum += fVal * fVal;}));
- auto aVal1 = pMat1->Collect(false, aOp);
+ auto aVal1 = pMat1->Collect(aOp);
fSum1 = aVal1[0].mfFirst + aVal1[0].mfRest;
fSumSqr1 = aVal1[1].mfFirst + aVal1[1].mfRest;
fCount1 = aVal1[2].mnCount;
- auto aVal2 = pMat2->Collect(false, aOp);
+ auto aVal2 = pMat2->Collect(aOp);
fSum2 = aVal2[0].mfFirst + aVal2[0].mfRest;
fSumSqr2 = aVal2[1].mfFirst + aVal2[1].mfRest;
fCount2 = aVal2[2].mnCount;
diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index b84e1fa19282..679eb35a4c10 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -324,7 +324,7 @@ public:
const ScFullMatrix::EmptyOpFunction& aEmptyFunc) const;
template<typename T>
- std::vector<ScMatrix::IterateResult> ApplyCollectOperation(bool bTextAsZero, const std::vector<std::unique_ptr<T>>& aOp);
+ std::vector<ScMatrix::IterateResult> ApplyCollectOperation(const std::vector<std::unique_ptr<T>>& aOp);
void MatConcat(SCSIZE nMaxCol, SCSIZE nMaxRow, const ScMatrixRef& xMat1, const ScMatrixRef& xMat2,
SvNumberFormatter& rFormatter, svl::SharedStringPool& rPool);
@@ -1178,10 +1178,9 @@ class WalkElementBlocksMultipleValues
const std::vector<std::unique_ptr<Op>>& maOp;
std::vector<ScMatrix::IterateResult> maRes;
bool mbFirst:1;
- bool mbTextAsZero:1;
public:
- WalkElementBlocksMultipleValues(bool bTextAsZero, const std::vector<std::unique_ptr<Op>>& aOp) :
- maOp(aOp), mbFirst(true), mbTextAsZero(bTextAsZero)
+ WalkElementBlocksMultipleValues(const std::vector<std::unique_ptr<Op>>& aOp) :
+ maOp(aOp), mbFirst(true)
{
for (const auto& rpOp : maOp)
{
@@ -1251,9 +1250,6 @@ public:
}
break;
case mdds::mtm::element_string:
- if (mbTextAsZero)
- maRes.back().mnCount += node.size;
- break;
case mdds::mtm::element_empty:
default:
;
@@ -2402,9 +2398,9 @@ void ScMatrixImpl::ApplyOperation(T aOp, ScMatrixImpl& rMat)
}
template<typename T>
-std::vector<ScMatrix::IterateResult> ScMatrixImpl::ApplyCollectOperation(bool bTextAsZero, const std::vector<std::unique_ptr<T>>& aOp)
+std::vector<ScMatrix::IterateResult> ScMatrixImpl::ApplyCollectOperation(const std::vector<std::unique_ptr<T>>& aOp)
{
- WalkElementBlocksMultipleValues<T> aFunc(bTextAsZero, aOp);
+ WalkElementBlocksMultipleValues<T> aFunc(aOp);
maMat.walk(aFunc);
return aFunc.getResult();
}
@@ -3453,9 +3449,9 @@ void ScFullMatrix::ExecuteOperation(const std::pair<size_t, size_t>& rStartPos,
pImpl->ExecuteOperation(rStartPos, rEndPos, aDoubleFunc, aBoolFunc, aStringFunc, aEmptyFunc);
}
-std::vector<ScMatrix::IterateResult> ScFullMatrix::Collect(bool bTextAsZero, const std::vector<std::unique_ptr<sc::op::Op>>& aOp)
+std::vector<ScMatrix::IterateResult> ScFullMatrix::Collect(const std::vector<std::unique_ptr<sc::op::Op>>& aOp)
{
- return pImpl->ApplyCollectOperation(bTextAsZero, aOp);
+ return pImpl->ApplyCollectOperation(aOp);
}
ScFullMatrix& ScFullMatrix::operator+= ( const ScFullMatrix& r )