[Libreoffice-commits] core.git: Branch 'feature/formula-core-rework' - sc/source

Kohei Yoshida kohei.yoshida at gmail.com
Wed Jul 3 12:14:24 PDT 2013


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

New commits:
commit 180ba887e532d6e0764e99665a852a787b9954ad
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 82daadf..98081356 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>
 
@@ -2172,7 +2173,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);
                 }
@@ -2261,7 +2270,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);
                 }
@@ -2276,7 +2293,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