Kaydet (Commit) 36e0d770 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

fdo#77728: Don't forget to start listening after the named range update.

Change-Id: I7a4160db0dd2b9ac2c98402bb6110c548e879b3d
üst 485dddac
...@@ -378,7 +378,8 @@ public: ...@@ -378,7 +378,8 @@ public:
void PreprocessRangeNameUpdate( void PreprocessRangeNameUpdate(
sc::EndListeningContext& rEndListenCxt, sc::CompileFormulaContext& rCompileCxt ); 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 SfxPoolItem* GetAttr( SCROW nRow, sal_uInt16 nWhich ) const;
const ScPatternAttr* GetPattern( SCROW nRow ) const; const ScPatternAttr* GetPattern( SCROW nRow ) const;
......
...@@ -854,7 +854,8 @@ public: ...@@ -854,7 +854,8 @@ public:
void PreprocessRangeNameUpdate( void PreprocessRangeNameUpdate(
sc::EndListeningContext& rEndListenCxt, sc::CompileFormulaContext& rCompileCxt ); sc::EndListeningContext& rEndListenCxt, sc::CompileFormulaContext& rCompileCxt );
void PostprocessRangeNameUpdate( sc::CompileFormulaContext& rCompileCxt ); void PostprocessRangeNameUpdate(
sc::StartListeningContext& rStartListenCxt, sc::CompileFormulaContext& rCompileCxt );
ScConditionalFormatList* GetCondFormList(); ScConditionalFormatList* GetCondFormList();
const ScConditionalFormatList* GetCondFormList() const; const ScConditionalFormatList* GetCondFormList() const;
......
...@@ -645,11 +645,13 @@ public: ...@@ -645,11 +645,13 @@ public:
class PostRangeNameUpdateHandler class PostRangeNameUpdateHandler
{ {
ScDocument* mpDoc; ScDocument* mpDoc;
sc::StartListeningContext& mrStartListenCxt;
sc::CompileFormulaContext& mrCompileFormulaCxt; sc::CompileFormulaContext& mrCompileFormulaCxt;
public: public:
PostRangeNameUpdateHandler( ScDocument* pDoc, sc::CompileFormulaContext& rCompileCxt ) : PostRangeNameUpdateHandler( ScDocument* pDoc, sc::StartListeningContext& rStartListenCxt, sc::CompileFormulaContext& rCompileCxt ) :
mpDoc(pDoc), mpDoc(pDoc),
mrStartListenCxt(rStartListenCxt),
mrCompileFormulaCxt(rCompileCxt) {} mrCompileFormulaCxt(rCompileCxt) {}
void operator() ( sc::FormulaGroupEntry& rEntry ) void operator() ( sc::FormulaGroupEntry& rEntry )
...@@ -677,6 +679,7 @@ public: ...@@ -677,6 +679,7 @@ public:
{ {
ScFormulaCell* p = *pp; ScFormulaCell* p = *pp;
p->SyncSharedCode(); p->SyncSharedCode();
p->StartListeningTo(mrStartListenCxt);
p->SetDirty(); p->SetDirty();
} }
} }
...@@ -697,6 +700,7 @@ public: ...@@ -697,6 +700,7 @@ public:
aComp2.CompileTokenArray(); aComp2.CompileTokenArray();
pCell->SetCode(pNewCode); pCell->SetCode(pNewCode);
pCell->StartListeningTo(mrStartListenCxt);
pCell->SetDirty(); pCell->SetDirty();
} }
} }
...@@ -715,12 +719,13 @@ void ScColumn::PreprocessRangeNameUpdate( ...@@ -715,12 +719,13 @@ void ScColumn::PreprocessRangeNameUpdate(
std::for_each(aGroups.begin(), aGroups.end(), aFunc); 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. // Collect all formula groups.
std::vector<sc::FormulaGroupEntry> aGroups = GetFormulaGroupEntries(); std::vector<sc::FormulaGroupEntry> aGroups = GetFormulaGroupEntries();
PostRangeNameUpdateHandler aFunc(pDocument, rCompileCxt); PostRangeNameUpdateHandler aFunc(pDocument, rStartListenCxt, rCompileCxt);
std::for_each(aGroups.begin(), aGroups.end(), aFunc); std::for_each(aGroups.begin(), aGroups.end(), aFunc);
} }
......
...@@ -255,12 +255,13 @@ void ScDocument::PreprocessRangeNameUpdate() ...@@ -255,12 +255,13 @@ void ScDocument::PreprocessRangeNameUpdate()
void ScDocument::PostprocessRangeNameUpdate() void ScDocument::PostprocessRangeNameUpdate()
{ {
sc::StartListeningContext aStartListenCxt(*this);
sc::CompileFormulaContext aCompileCxt(this); sc::CompileFormulaContext aCompileCxt(this);
TableContainer::iterator it = maTabs.begin(), itEnd = maTabs.end(); TableContainer::iterator it = maTabs.begin(), itEnd = maTabs.end();
for (; it != itEnd; ++it) for (; it != itEnd; ++it)
{ {
ScTable* p = *it; ScTable* p = *it;
p->PostprocessRangeNameUpdate(aCompileCxt); p->PostprocessRangeNameUpdate(aStartListenCxt, aCompileCxt);
} }
} }
......
...@@ -96,10 +96,11 @@ void ScTable::PreprocessRangeNameUpdate( ...@@ -96,10 +96,11 @@ void ScTable::PreprocessRangeNameUpdate(
aCol[i].PreprocessRangeNameUpdate(rEndListenCxt, rCompileCxt); 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) 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 ) void ScTable::UpdateScriptTypes( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment