[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source

Eike Rathke erack at redhat.com
Wed Jan 15 16:44:52 PST 2014


 sc/source/core/data/column.cxx |   11 ++++++++++-
 sc/source/core/data/table2.cxx |    8 ++++----
 2 files changed, 14 insertions(+), 5 deletions(-)

New commits:
commit d72321b665f54946cf603e6f30740f31151c898f
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Jan 15 23:09:20 2014 +0100

    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 at kohei.us>
    Tested-by: Kohei Yoshida <libreoffice at kohei.us>

diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 145f61a..aafb314 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 30771ab..27233f7 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())


More information about the Libreoffice-commits mailing list