[Libreoffice-commits] core.git: Branch 'feature/calc-group-interpreter' - sc/source

Kohei Yoshida kohei.yoshida at gmail.com
Wed Jul 3 12:44:17 PDT 2013


 sc/source/core/data/column2.cxx |   25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

New commits:
commit a3aaf1dfe355e4fcc3e8ff2758f6dc137294dd1c
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Wed Jul 3 15:12:32 2013 -0400

    Allow fallback to cell-based calculation.
    
    when cell groups are circular dependent.
    
    Change-Id: I20b3e522d6bfe4b70e0f59fe64eac065c9509bd9

diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 542cd92..932e613 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -62,6 +62,7 @@
 #include <svl/broadcast.hxx>
 #include <svl/listeneriter.hxx>
 #include <vcl/outdev.hxx>
+#include "formula/errorcodes.hxx"
 
 #include <boost/scoped_ptr.hpp>
 
@@ -2175,7 +2176,15 @@ bool appendDouble(
                 {
                     ScFormulaCell& rFC = **itData;
                     if (!rFC.GetErrorOrValue(nErr, fVal) || nErr)
+                    {
+                        if (nErr == ScErrorCodes::errCircularReference)
+                        {
+                            // This cell needs to be recalculated on next visit.
+                            rFC.SetErrCode(0);
+                            rFC.SetDirtyVar();
+                        }
                         return false;
+                    }
 
                     rArray.push_back(fVal);
                 }
@@ -2264,7 +2273,15 @@ const double* ScColumn::FetchDoubleArray( sc::FormulaGroupContext& rCxt, SCROW n
                 {
                     ScFormulaCell& rCell = **it;
                     if (!rCell.GetErrorOrValue(nErr, fVal) || nErr)
+                    {
+                        if (nErr == ScErrorCodes::errCircularReference)
+                        {
+                            // This cell needs to be recalculated on next visit.
+                            rCell.SetErrCode(0);
+                            rCell.SetDirtyVar();
+                        }
                         return NULL;
+                    }
 
                     rArray.push_back(fVal);
                 }
@@ -2279,7 +2296,15 @@ const double* ScColumn::FetchDoubleArray( sc::FormulaGroupContext& rCxt, SCROW n
             {
                 ScFormulaCell& rCell = **it;
                 if (!rCell.GetErrorOrValue(nErr, fVal) || nErr)
+                {
+                    if (nErr == ScErrorCodes::errCircularReference)
+                    {
+                        // This cell needs to be recalculated on next visit.
+                        rCell.SetErrCode(0);
+                        rCell.SetDirtyVar();
+                    }
                     return NULL;
+                }
 
                 rArray.push_back(fVal);
             }


More information about the Libreoffice-commits mailing list