summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-07-05 15:11:34 +0200
committerCaolán McNamara <caolanm@redhat.com>2016-07-05 13:59:39 +0000
commit9a9e1e6fdd5f0a2553d98818c31627be077deca9 (patch)
tree1ad202e1fe999798d19d527b590fd01f6976b967
parentd89e803f621f6722d5f7dbe5ea4af4018b0b6851 (diff)
Resolves: tdf#90285 do not reuse the same StartListeningContext
... that after UpdateInsertTab and related may point into broadcasters' ColumnBlockPosition that have been shifted to the next sheet. Change-Id: I6f657021b6102cec427734a8ff3105f0c4309a7a (cherry picked from commit dd7a2c95b86d158be8d0637bdff13b9a0ed9954b) Reviewed-on: https://gerrit.libreoffice.org/26957 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-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 77be2ded3879..dddcde6aed63 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -826,7 +826,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)
{
@@ -873,6 +872,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);
@@ -918,6 +918,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);