summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/core/data/documen2.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 97607d4e4123..57ee5f4a242b 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -808,7 +808,6 @@ bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM
sc::AutoCalcSwitch aACSwitch(*this, false);
sc::RefUpdateInsertTabContext aCxt( *this, nNewPos, 1);
- sc::StartListeningContext aSLCxt(*this);
if (bValid)
{
@@ -855,6 +854,7 @@ bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM
if (*it && it != maTabs.begin()+nOldPos && it != maTabs.begin() + nNewPos)
(*it)->UpdateCompile();
SetNoListening( false );
+ sc::StartListeningContext aSLCxt(*this);
for (TableContainer::iterator it = maTabs.begin(); it != maTabs.end(); ++it)
if (*it && it != maTabs.begin()+nOldPos && it != maTabs.begin()+nNewPos)
(*it)->StartListeners(aSLCxt, true);
@@ -891,6 +891,7 @@ bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM
maTabs[nOldPos]->UpdateCompile();
maTabs[nNewPos]->UpdateCompile( true ); // maybe already compiled in Clone, but used names need recompilation
SetNoListening( false );
+ sc::StartListeningContext aSLCxt(*this);
maTabs[nOldPos]->StartListeners(aSLCxt, true);
maTabs[nNewPos]->StartListeners(aSLCxt, true);