summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2014-01-15 23:09:20 +0100
committerKohei Yoshida <libreoffice@kohei.us>2014-01-16 00:44:29 +0000
commitd72321b665f54946cf603e6f30740f31151c898f (patch)
tree161b6922b2a1e98b138b2085b02d0dead4b8b560
parent370204f97ff950b6bae9c9d9a91da5ef1baeff10 (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 (cherry picked from commit 42f551d524a1df46f6a311d5897ac30bd8fc1aaf) Reviewed-on: https://gerrit.libreoffice.org/7452 Reviewed-by: Kohei Yoshida <libreoffice@kohei.us> Tested-by: Kohei Yoshida <libreoffice@kohei.us>
-rw-r--r--sc/source/core/data/column.cxx11
-rw-r--r--sc/source/core/data/table2.cxx8
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())