diff options
author | Eike Rathke <erack@redhat.com> | 2014-01-15 23:09:20 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2014-01-15 23:14:05 +0100 |
commit | 42f551d524a1df46f6a311d5897ac30bd8fc1aaf (patch) | |
tree | 38a8ef81bf466811fecf481c6cb14f80358a888c | |
parent | ef37781683e28d1837cfce86de990e59d2c10c5f (diff) |
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
-rw-r--r-- | sc/source/core/data/column.cxx | 11 | ||||
-rw-r--r-- | sc/source/core/data/table2.cxx | 8 |
2 files changed, 14 insertions, 5 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 145f61a210ab..aafb3149abc0 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -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); diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 30771ab49090..27233f77c94e 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -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()) |