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

fdo#78903: Don't broadcast prematurely during cell deletion.

We need to wait until all the affected cells get marked dirty at the
end of the deletion process.

Change-Id: I49618fcc386ec2209f5f0267d50257ecb8dd21d1
üst fa2751ea
...@@ -169,11 +169,6 @@ public: ...@@ -169,11 +169,6 @@ public:
maRows.push_back(i + nTopRow); maRows.push_back(i + nTopRow);
} }
void endFormulas()
{
mrDoc.EndListeningFormulaCells(maFormulaCells);
}
const std::vector<SCROW>& getNonEmptyRows() const const std::vector<SCROW>& getNonEmptyRows() const
{ {
return maRows; return maRows;
...@@ -266,12 +261,6 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize ) ...@@ -266,12 +261,6 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize )
sc::AutoCalcSwitch aACSwitch(*pDocument, false); sc::AutoCalcSwitch aACSwitch(*pDocument, false);
// Parse all non-empty cells in the range to pick up their row positions,
// and end all formula cells.
DeleteRowsHandler aDeleteRowsFunc(*pDocument);
sc::ProcessFormula(itCell, maCells, nStartRow, nEndRow, aDeleteRowsFunc, aDeleteRowsFunc);
aDeleteRowsFunc.endFormulas();
// Remove the cells. // Remove the cells.
maCells.erase(nStartRow, nEndRow); maCells.erase(nStartRow, nEndRow);
maCells.resize(MAXROWCOUNT); maCells.resize(MAXROWCOUNT);
...@@ -285,22 +274,11 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize ) ...@@ -285,22 +274,11 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize )
sc::SharedFormulaUtil::joinFormulaCellAbove(aPos); sc::SharedFormulaUtil::joinFormulaCellAbove(aPos);
// Single cell broadcasts on deleted cells.
BroadcastCells(aDeleteRowsFunc.getNonEmptyRows(), SC_HINT_DATACHANGED);
// Shift the text attribute array too (before the broadcast). // Shift the text attribute array too (before the broadcast).
maCellTextAttrs.erase(nStartRow, nEndRow); maCellTextAttrs.erase(nStartRow, nEndRow);
maCellTextAttrs.resize(MAXROWCOUNT); maCellTextAttrs.resize(MAXROWCOUNT);
CellStorageModified(); CellStorageModified();
if (!bShiftCells)
return;
// Do area broadcast on the old non-empty cell ranges prior to the shift.
sc::SingleColumnSpanSet::SpansType aSpans;
aNonEmptySpans.getSpans(aSpans);
std::for_each(aSpans.begin(), aSpans.end(), RangeBroadcaster(*pDocument, nTab, nCol));
} }
sc::CellStoreType::iterator ScColumn::GetPositionToInsert( SCROW nRow ) sc::CellStoreType::iterator ScColumn::GetPositionToInsert( SCROW nRow )
......
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