[Libreoffice-commits] core.git: Branch 'feature/formula-core-rework' - sc/source

Kohei Yoshida kohei.yoshida at gmail.com
Mon Jul 8 12:19:22 PDT 2013


 sc/source/core/data/column.cxx |   18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

New commits:
commit e4f9097d7542c8dbecfa133757d76fb6a3f66505
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Mon Jul 8 15:19:04 2013 -0400

    Re-group formula cells on paste.
    
    Change-Id: Ia5251a3bc8387289056abacbb4836b77262aad12

diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 6744c13..fad7edd 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -2267,9 +2267,23 @@ bool ScColumn::UpdateReference(
 {
     if (eUpdateRefMode == URM_COPY)
     {
+        // When copying, the range equals the destination range where cells
+        // are pasted, and the dx, dy, dz refer to the distance from the
+        // source range.
+
         UpdateRefOnCopy aHandler(rRange, nDx, nDy, nDz, pUndoDoc);
-        FormulaCellsUndecided(rRange.aStart.Row(), rRange.aEnd.Row());
-        sc::ProcessBlock(maCells.begin(), maCells, aHandler, rRange.aStart.Row(), rRange.aEnd.Row());
+        sc::CellStoreType::position_type aPos = maCells.position(rRange.aStart.Row());
+        sc::ProcessBlock(aPos.first, maCells, aHandler, rRange.aStart.Row(), rRange.aEnd.Row());
+
+        // The formula groups at the top and bottom boundaries are expected to
+        // have been split prior to this call. Here, we only do the joining.
+        JoinFormulaCellAbove(aPos);
+        if (rRange.aEnd.Row() < MAXROW)
+        {
+            aPos = maCells.position(aPos.first, rRange.aEnd.Row()+1);
+            JoinFormulaCellAbove(aPos);
+        }
+
         return aHandler.isUpdated();
     }
 


More information about the Libreoffice-commits mailing list