summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-03-29 11:32:54 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-03-29 15:34:39 +0200
commit769406ccf677fd05c2df30f9a11dce2f5e90ff0a (patch)
tree3d2d25038653e9ebfb6bc5d16ae5921fcd8fba99 /sc
parent08151f4827cc954188243f06660076534bc30c1f (diff)
expand COp to its only use
Change-Id: Ic353adf44c7aa60cedc2c61e3814d3135e0d55ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113310 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/scmatrix.cxx33
1 files changed, 2 insertions, 31 deletions
diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index 1306add318a7..6dad97eee6a0 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -3297,35 +3297,6 @@ namespace matop {
namespace {
-/**
- * COp struct is used in MatOp class to provide (through template specialization)
- * different actions for empty entries in a matrix.
- */
-template <typename T, typename S>
-struct COp {};
-
-}
-
-template <typename T>
-struct COp<T, svl::SharedString>
-{
- const svl::SharedString& operator()(T /*aOp*/, double /*a*/, double /*b*/, const svl::SharedString& rString) const
- {
- return rString;
- }
-};
-
-template <typename T>
-struct COp<T, double>
-{
- double operator()(T aOp, double a, double b, const svl::SharedString& /*rString*/) const
- {
- return aOp( a, b);
- }
-};
-
-namespace {
-
/** A template for operations where operands are supposed to be numeric.
A non-numeric (string) operand leads to the configured conversion to number
method being called if in interpreter context and a FormulaError::NoValue DoubleError
@@ -3341,7 +3312,6 @@ private:
ScInterpreter* mpErrorInterpreter;
svl::SharedString maString;
double mfVal;
- COp<TOp, double> maCOp;
public:
typedef double number_value_type;
@@ -3376,9 +3346,10 @@ public:
return maOp( convertStringToValue( mpErrorInterpreter, rStr.getString()), mfVal);
}
+ /// the action for empty entries in a matrix
double operator()(char) const
{
- return maCOp(maOp, 0, mfVal, maString);
+ return maOp(0, mfVal);
}
static bool useFunctionForEmpty()