From f4820471141fb2cfc3e9fd60d94150ca94f2fbd7 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Wed, 16 Sep 2015 12:38:06 +0200 Subject: Resolves: tdf#94249 do not remove broadcasters while iterators are in use MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit EndListeningContext holds BroadcasterStoreType iterators in its ColumnBlockPositionSet and collects broadcasters to purge them at the end. Removing broadcasters from ScColumn::maBroadcasters in between invalidates the iterators. Hence calling the "normal" EndListening() that removes a broadcaster when all listeners are gone while an EndListeningContext is in use is bad. Change-Id: Ibdd88469e91e6173ceff1f391c23ef7cb7c6f596 (cherry picked from commit e4a8ae0bf54476e9a0c9e1f5348c05f3cd838899) Reviewed-on: https://gerrit.libreoffice.org/18618 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sc/source/core/data/column3.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sc/source/core/data/column3.cxx') diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 2b8bdac7332d..f0251fda9fef 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -327,13 +327,13 @@ void ScColumn::DetachFormulaCells( const sc::CellStoreType::position_type& aPos, size_t nLength ) { // Split formula grouping at the top and bottom boundaries. - sc::SharedFormulaUtil::splitFormulaCellGroup(aPos); + sc::SharedFormulaUtil::splitFormulaCellGroup(aPos, nullptr); size_t nRow = aPos.first->position + aPos.second; size_t nNextTopRow = nRow + nLength; // start row of next formula group. if (ValidRow(nNextTopRow)) { sc::CellStoreType::position_type aPos2 = maCells.position(aPos.first, nNextTopRow); - sc::SharedFormulaUtil::splitFormulaCellGroup(aPos2); + sc::SharedFormulaUtil::splitFormulaCellGroup(aPos2, nullptr); } if (pDocument->IsClipOrUndo()) @@ -368,11 +368,11 @@ void ScColumn::DetachFormulaCells( sc::EndListeningContext& rCxt, SCROW nRow1, S sc::CellStoreType::iterator it = aPos.first; // Split formula grouping at the top and bottom boundaries. - sc::SharedFormulaUtil::splitFormulaCellGroup(aPos); + sc::SharedFormulaUtil::splitFormulaCellGroup(aPos, &rCxt); if (ValidRow(nRow2+1)) { aPos = maCells.position(it, nRow2+1); - sc::SharedFormulaUtil::splitFormulaCellGroup(aPos); + sc::SharedFormulaUtil::splitFormulaCellGroup(aPos, &rCxt); } if (pDocument->IsClipOrUndo()) -- cgit v1.2.3