diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-03-29 11:21:34 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-03-29 15:03:41 +0200 |
commit | da819b57f616f69a97021c0a448c5184f05f34ac (patch) | |
tree | 386bd231e9a710905b164191cee9d2e55900450a /sc | |
parent | dc66835f902a4704bf9c8de765acef0e68070e7c (diff) |
TEmptyRes is always double
Change-Id: Ie1d2ce048aecb98f16a407bd2e708b64db46aadd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113309
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/scmatrix.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index bad26ddab1ee..1306add318a7 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -3332,10 +3332,8 @@ namespace { if conversion was not possible, else to an unconditional FormulaError::NoValue DoubleError. An empty operand evaluates to 0. - XXX: semantically TEmptyRes and types other than number_value_type are - unused, but this template could serve as a basis for future enhancements. */ -template<typename TOp, typename TEmptyRes=double> +template<typename TOp> struct MatOp { private: @@ -3343,7 +3341,7 @@ private: ScInterpreter* mpErrorInterpreter; svl::SharedString maString; double mfVal; - COp<TOp, TEmptyRes> maCOp; + COp<TOp, double> maCOp; public: typedef double number_value_type; @@ -3378,7 +3376,7 @@ public: return maOp( convertStringToValue( mpErrorInterpreter, rStr.getString()), mfVal); } - TEmptyRes operator()(char) const + double operator()(char) const { return maCOp(maOp, 0, mfVal, maString); } @@ -3396,14 +3394,14 @@ public: void ScMatrix::NotOp( const ScMatrix& rMat) { auto not_ = [](double a, double){return double(a == 0.0);}; - matop::MatOp<decltype(not_), double> aOp(not_, pImpl->GetErrorInterpreter()); + matop::MatOp<decltype(not_)> aOp(not_, pImpl->GetErrorInterpreter()); pImpl->ApplyOperation(aOp, *rMat.pImpl); } void ScMatrix::NegOp( const ScMatrix& rMat) { auto neg_ = [](double a, double){return -a;}; - matop::MatOp<decltype(neg_), double> aOp(neg_, pImpl->GetErrorInterpreter()); + matop::MatOp<decltype(neg_)> aOp(neg_, pImpl->GetErrorInterpreter()); pImpl->ApplyOperation(aOp, *rMat.pImpl); } |