Kaydet (Commit) 42f551d5 authored tarafından Eike Rathke's avatar Eike Rathke

resolved fdo#72293 correctly split grouped formulas and regroup

Grouped formulas need to be split at both edges of the deleted area,
regroup _after_ rows have been deleted.

Change-Id: I840806f30cef592e17b4cd3a33c81fd2a8309055
üst ef377816
......@@ -2444,7 +2444,16 @@ bool ScColumn::UpdateReference( sc::RefUpdateContext& rCxt, ScDocument* pUndoDoc
{
// Cells in this column is being shifted. Split formula grouping at
// the top and bottom boundaries before they get shifted.
SCROW nSplitPos = rCxt.maRange.aStart.Row();
// Also, for deleted rows split at the top of the deleted area to adapt
// the affected group length.
SCROW nSplitPos;
if (rCxt.mnRowDelta < 0)
{
nSplitPos = rCxt.maRange.aStart.Row() + rCxt.mnRowDelta;
if (ValidRow(nSplitPos))
aBounds.push_back(nSplitPos);
}
nSplitPos = rCxt.maRange.aStart.Row();
if (ValidRow(nSplitPos))
{
aBounds.push_back(nSplitPos);
......
......@@ -239,16 +239,16 @@ void ScTable::DeleteRow(
}
}
std::vector<SCCOL> aRegroupCols;
rRegroupCols.getColumns(nTab, aRegroupCols);
std::for_each(aRegroupCols.begin(), aRegroupCols.end(), ColumnRegroupFormulaCells(aCol));
{ // scope for bulk broadcast
ScBulkBroadcast aBulkBroadcast( pDocument->GetBASM());
for (SCCOL j=nStartCol; j<=nEndCol; j++)
aCol[j].DeleteRow( nStartRow, nSize );
}
std::vector<SCCOL> aRegroupCols;
rRegroupCols.getColumns(nTab, aRegroupCols);
std::for_each(aRegroupCols.begin(), aRegroupCols.end(), ColumnRegroupFormulaCells(aCol));
InvalidatePageBreaks();
if (IsStreamValid())
......
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