[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/inc sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Fri Apr 25 09:10:46 PDT 2014


 sc/inc/column.hxx                  |    3 ++-
 sc/inc/table.hxx                   |    3 ++-
 sc/source/core/data/column4.cxx    |   11 ++++++++---
 sc/source/core/data/document10.cxx |    3 ++-
 sc/source/core/data/table7.cxx     |    5 +++--
 5 files changed, 17 insertions(+), 8 deletions(-)

New commits:
commit 160bcf5357fb565b2f27f8b12e75d408f939e069
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Apr 24 21:49:45 2014 -0400

    fdo#77728: Don't forget to start listening after the named range update.
    
    Change-Id: I7a4160db0dd2b9ac2c98402bb6110c548e879b3d
    (cherry picked from commit 36e0d770928f71c932db5dea9f04645f65222ea6)
    Reviewed-on: https://gerrit.libreoffice.org/9156
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index d77fc18..092ec06 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -369,7 +369,8 @@ public:
     void PreprocessRangeNameUpdate(
         sc::EndListeningContext& rEndListenCxt, sc::CompileFormulaContext& rCompileCxt );
 
-    void PostprocessRangeNameUpdate( sc::CompileFormulaContext& rCompileCxt );
+    void PostprocessRangeNameUpdate(
+        sc::StartListeningContext& rStartListenCxt, sc::CompileFormulaContext& rCompileCxt );
 
     const SfxPoolItem*      GetAttr( SCROW nRow, sal_uInt16 nWhich ) const;
     const ScPatternAttr*    GetPattern( SCROW nRow ) const;
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 6666c9b..108637b 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -856,7 +856,8 @@ public:
     void PreprocessRangeNameUpdate(
         sc::EndListeningContext& rEndListenCxt, sc::CompileFormulaContext& rCompileCxt );
 
-    void PostprocessRangeNameUpdate( sc::CompileFormulaContext& rCompileCxt );
+    void PostprocessRangeNameUpdate(
+        sc::StartListeningContext& rStartListenCxt, sc::CompileFormulaContext& rCompileCxt );
 
     ScConditionalFormatList* GetCondFormList();
     const ScConditionalFormatList* GetCondFormList() const;
diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx
index 1855278..baa00e0 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -202,11 +202,13 @@ public:
 class PostRangeNameUpdateHandler
 {
     ScDocument* mpDoc;
+    sc::StartListeningContext& mrStartListenCxt;
     sc::CompileFormulaContext& mrCompileFormulaCxt;
 
 public:
-    PostRangeNameUpdateHandler( ScDocument* pDoc, sc::CompileFormulaContext& rCompileCxt ) :
+    PostRangeNameUpdateHandler( ScDocument* pDoc, sc::StartListeningContext& rStartListenCxt, sc::CompileFormulaContext& rCompileCxt ) :
         mpDoc(pDoc),
+        mrStartListenCxt(rStartListenCxt),
         mrCompileFormulaCxt(rCompileCxt) {}
 
     void operator() ( sc::FormulaGroupEntry& rEntry )
@@ -234,6 +236,7 @@ public:
                 {
                     ScFormulaCell* p = *pp;
                     p->SyncSharedCode();
+                    p->StartListeningTo(mrStartListenCxt);
                     p->SetDirty();
                 }
             }
@@ -254,6 +257,7 @@ public:
                 aComp2.CompileTokenArray();
 
                 pCell->SetCode(pNewCode);
+                pCell->StartListeningTo(mrStartListenCxt);
                 pCell->SetDirty();
             }
         }
@@ -272,12 +276,13 @@ void ScColumn::PreprocessRangeNameUpdate(
     std::for_each(aGroups.begin(), aGroups.end(), aFunc);
 }
 
-void ScColumn::PostprocessRangeNameUpdate( sc::CompileFormulaContext& rCompileCxt )
+void ScColumn::PostprocessRangeNameUpdate(
+    sc::StartListeningContext& rStartListenCxt, sc::CompileFormulaContext& rCompileCxt )
 {
     // Collect all formula groups.
     std::vector<sc::FormulaGroupEntry> aGroups = GetFormulaGroupEntries();
 
-    PostRangeNameUpdateHandler aFunc(pDocument, rCompileCxt);
+    PostRangeNameUpdateHandler aFunc(pDocument, rStartListenCxt, rCompileCxt);
     std::for_each(aGroups.begin(), aGroups.end(), aFunc);
 }
 
diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx
index 0c9e7ed..a4ede21 100644
--- a/sc/source/core/data/document10.cxx
+++ b/sc/source/core/data/document10.cxx
@@ -59,12 +59,13 @@ void ScDocument::PreprocessRangeNameUpdate()
 
 void ScDocument::PostprocessRangeNameUpdate()
 {
+    sc::StartListeningContext aStartListenCxt(*this);
     sc::CompileFormulaContext aCompileCxt(this);
     TableContainer::iterator it = maTabs.begin(), itEnd = maTabs.end();
     for (; it != itEnd; ++it)
     {
         ScTable* p = *it;
-        p->PostprocessRangeNameUpdate(aCompileCxt);
+        p->PostprocessRangeNameUpdate(aStartListenCxt, aCompileCxt);
     }
 }
 
diff --git a/sc/source/core/data/table7.cxx b/sc/source/core/data/table7.cxx
index b5ebc12..2e6aad1 100644
--- a/sc/source/core/data/table7.cxx
+++ b/sc/source/core/data/table7.cxx
@@ -49,10 +49,11 @@ void ScTable::PreprocessRangeNameUpdate(
         aCol[i].PreprocessRangeNameUpdate(rEndListenCxt, rCompileCxt);
 }
 
-void ScTable::PostprocessRangeNameUpdate( sc::CompileFormulaContext& rCompileCxt )
+void ScTable::PostprocessRangeNameUpdate(
+    sc::StartListeningContext& rStartListenCxt, sc::CompileFormulaContext& rCompileCxt )
 {
     for (SCCOL i = 0; i <= MAXCOL; ++i)
-        aCol[i].PostprocessRangeNameUpdate(rCompileCxt);
+        aCol[i].PostprocessRangeNameUpdate(rStartListenCxt, rCompileCxt);
 }
 
 void ScTable::UpdateScriptTypes( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 )


More information about the Libreoffice-commits mailing list