summaryrefslogtreecommitdiff
path: root/sc/source/core/data
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-04-24 21:49:45 -0400
committerEike Rathke <erack@redhat.com>2014-04-25 16:10:18 +0000
commit160bcf5357fb565b2f27f8b12e75d408f939e069 (patch)
treed31420681b552d2a9b885037b8acf5f13463cdc4 /sc/source/core/data
parent9f115c83fe94b0ed86562906f9d96465e59ec761 (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>
Diffstat (limited to 'sc/source/core/data')
-rw-r--r--sc/source/core/data/column4.cxx11
-rw-r--r--sc/source/core/data/document10.cxx3
-rw-r--r--sc/source/core/data/table7.cxx5
3 files changed, 13 insertions, 6 deletions
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 )