diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-04-24 21:49:45 -0400 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2014-04-25 16:10:18 +0000 |
commit | 160bcf5357fb565b2f27f8b12e75d408f939e069 (patch) | |
tree | d31420681b552d2a9b885037b8acf5f13463cdc4 | |
parent | 9f115c83fe94b0ed86562906f9d96465e59ec761 (diff) |
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@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r-- | sc/inc/column.hxx | 3 | ||||
-rw-r--r-- | sc/inc/table.hxx | 3 | ||||
-rw-r--r-- | sc/source/core/data/column4.cxx | 11 | ||||
-rw-r--r-- | sc/source/core/data/document10.cxx | 3 | ||||
-rw-r--r-- | sc/source/core/data/table7.cxx | 5 |
5 files changed, 17 insertions, 8 deletions
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index d77fc18c3f54..092ec069a5c9 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 6666c9bffdf7..108637b848a9 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 1855278795b2..baa00e0a8baf 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 0c9e7edd45a5..a4ede21256b1 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 b5ebc125946d..2e6aad13f86c 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 ) |