From dff1d0abc3e66277da76c60943ec6bc92c29b14f Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Tue, 5 Jul 2016 15:11:34 +0200 Subject: Resolves: tdf#90285 do not reuse the same StartListeningContext MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... 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/26959 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sc/source/core/data/documen2.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- cgit