[Libreoffice-commits] .: Branch 'feature/matrix-new-backend' - sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Tue Jul 17 13:24:04 PDT 2012


 sc/source/core/tool/scmatrix.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 66f28008a5b2b9b3f4ddade252ca3fa1cfcd61c1
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Tue Jul 17 16:26:14 2012 -0400

    Turns out that C++03 doesn't support use of static double inside template.
    
    static int works, however.  C++11 solves this via constexpr keyword.
    
    Change-Id: I86f913129cbc65639ec2bf4b23843a5b25bd9146

diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index 4dfa738..8560c0d 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -966,7 +966,7 @@ namespace {
 
 struct SumOp
 {
-    static const double initVal = 0.0;
+    static const int InitVal = 0;
 
     void operator() (double& rAccum, double fVal)
     {
@@ -976,7 +976,7 @@ struct SumOp
 
 struct SumSquareOp
 {
-    static const double initVal = 0.0;
+    static const int InitVal = 0;
 
     void operator() (double& rAccum, double fVal)
     {
@@ -986,7 +986,7 @@ struct SumSquareOp
 
 struct ProductOp
 {
-    static const double initVal = 1.0;
+    static const int InitVal = 1;
 
     void operator() (double& rAccum, double fVal)
     {
@@ -1003,7 +1003,7 @@ class WalkElementBlocks : std::unary_function<MatrixImplType::element_block_node
     bool mbFirst:1;
     bool mbTextAsZero:1;
 public:
-    WalkElementBlocks(bool bTextAsZero) : maRes(0.0, _Op::initVal, 0), mbFirst(true), mbTextAsZero(bTextAsZero) {}
+    WalkElementBlocks(bool bTextAsZero) : maRes(0.0, _Op::InitVal, 0), mbFirst(true), mbTextAsZero(bTextAsZero) {}
 
     const ScMatrix::IterateResult& getResult() const { return maRes; }
 


More information about the Libreoffice-commits mailing list