summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-11-21 19:21:48 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-23 17:53:55 +0100
commitbaf08f569fb629211e4f9679bbb30fd61272dd46 (patch)
tree693f391f6b84a77c3bcaf5ed8f320d985a47d88e /sc
parentb4f666f2e677b05cab8395fe7972b45b15f60c3f (diff)
enum ScMatrix::Op is unnecessary
Change-Id: If4ae97b43f012f1770213d99407ffaadac05f9de Reviewed-on: https://gerrit.libreoffice.org/63756 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/qa/unit/ucalc.cxx2
-rw-r--r--sc/source/core/tool/interpr5.cxx2
-rw-r--r--sc/source/core/tool/scmatrix.cxx21
4 files changed, 9 insertions, 20 deletions
diff --git a/sc/inc/scmatrix.hxx b/sc/inc/scmatrix.hxx
index 4b58cd19217b..cb6f170cfcce 100644
--- a/sc/inc/scmatrix.hxx
+++ b/sc/inc/scmatrix.hxx
@@ -127,8 +127,6 @@ public:
ScMatrix( size_t nC, size_t nR, const std::vector<double>& rInitVals );
~ScMatrix();
- enum Op { Add, Sub, Mul, Div };
-
typedef std::function<void(size_t, size_t, double)> DoubleOpFunction;
typedef std::function<void(size_t, size_t, bool)> BoolOpFunction;
typedef std::function<void(size_t, size_t, svl::SharedString)> StringOpFunction;
@@ -391,7 +389,7 @@ public:
* otherwise they become NaN values.
*/
void GetDoubleArray( std::vector<double>& rArray, bool bEmptyAsZero = true ) const ;
- void MergeDoubleArray( std::vector<double>& rArray, Op eOp ) const ;
+ void MergeDoubleArrayMultiply( std::vector<double>& rArray ) const ;
void NotOp(ScMatrix& rMat) ;
void NegOp(ScMatrix& rMat) ;
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 6853c66ac0ae..be249c6f647e 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -1855,7 +1855,7 @@ void Test::testMatrix()
pMat2 = new ScMatrix(3, 3, 10.0);
pMat2->PutString(rPool.intern("B"), 1, 0);
- pMat2->MergeDoubleArray(aDoubles, ScMatrix::Mul);
+ pMat2->MergeDoubleArrayMultiply(aDoubles);
{
const double pChecks[] = { 25, 12, 0, fNaN, fNaN, 0, 0, 23, -200 };
diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx
index b1c840e4fd94..2ab00919d6fa 100644
--- a/sc/source/core/tool/interpr5.cxx
+++ b/sc/source/core/tool/interpr5.cxx
@@ -1672,7 +1672,7 @@ void ScInterpreter::ScSumProduct()
return;
}
- pMat->MergeDoubleArray(aResArray, ScMatrix::Mul);
+ pMat->MergeDoubleArrayMultiply(aResArray);
}
double fSum = std::for_each(aResArray.begin(), aResArray.end(), SumValues()).getValue();
diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index 5a736dd005b8..6cd50a560050 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -319,7 +319,7 @@ public:
ScMatrixRef CompareMatrix( sc::Compare& rComp, size_t nMatPos, sc::CompareOptions* pOptions ) const;
void GetDoubleArray( std::vector<double>& rArray, bool bEmptyAsZero ) const;
- void MergeDoubleArray( std::vector<double>& rArray, ScMatrix::Op eOp ) const;
+ void MergeDoubleArrayMultiply( std::vector<double>& rArray ) const;
template<typename T>
void ApplyOperation(T aOp, ScMatrixImpl& rMat);
@@ -2181,24 +2181,15 @@ void ScMatrixImpl::GetDoubleArray( std::vector<double>& rArray, bool bEmptyAsZer
aFunc.swap(rArray);
}
-void ScMatrixImpl::MergeDoubleArray( std::vector<double>& rArray, ScMatrix::Op eOp ) const
+void ScMatrixImpl::MergeDoubleArrayMultiply( std::vector<double>& rArray ) const
{
MatrixImplType::size_pair_type aSize = maMat.size();
size_t nSize = aSize.row*aSize.column;
if (nSize != rArray.size())
return;
- switch (eOp)
- {
- case ScMatrix::Mul:
- {
- MergeDoubleArrayFunc<ArrayMul> aFunc(rArray);
- maMat.walk(std::move(aFunc));
- }
- break;
- default:
- ;
- }
+ MergeDoubleArrayFunc<ArrayMul> aFunc(rArray);
+ maMat.walk(std::move(aFunc));
}
namespace Op {
@@ -3289,9 +3280,9 @@ void ScMatrix::GetDoubleArray( std::vector<double>& rArray, bool bEmptyAsZero )
pImpl->GetDoubleArray(rArray, bEmptyAsZero);
}
-void ScMatrix::MergeDoubleArray( std::vector<double>& rArray, Op eOp ) const
+void ScMatrix::MergeDoubleArrayMultiply( std::vector<double>& rArray ) const
{
- pImpl->MergeDoubleArray(rArray, eOp);
+ pImpl->MergeDoubleArrayMultiply(rArray);
}
namespace matop {