[Libreoffice-commits] core.git: sc/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Mar 29 13:35:17 UTC 2021


 sc/source/core/tool/scmatrix.cxx |   33 ++-------------------------------
 1 file changed, 2 insertions(+), 31 deletions(-)

New commits:
commit 769406ccf677fd05c2df30f9a11dce2f5e90ff0a
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Mar 29 11:32:54 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Mar 29 15:34:39 2021 +0200

    expand COp to its only use
    
    Change-Id: Ic353adf44c7aa60cedc2c61e3814d3135e0d55ac
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113310
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

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()


More information about the Libreoffice-commits mailing list