[Libreoffice-commits] core.git: Branch 'feature/calc-group-interpreter' - 2 commits - sc/source

Kohei Yoshida kohei.yoshida at gmail.com
Tue Jul 9 20:42:16 PDT 2013


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

New commits:
commit 2bcdb267d91f198bf4f8a14b8c045f35ac921003
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Tue Jul 9 23:43:37 2013 -0400

    Check formula cell group boundaries to optionally merge.
    
    Just in case...
    
    Change-Id: If1feac9f144a8ab7d53823a0625560a499d57b68

diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index cbf45db..70bd46b 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1373,9 +1373,22 @@ public:
                 // Group the cloned formula cells.
                 groupFormulaCells(aCloned);
 
-                maDestPos.miCellPos = mrDestCol.GetCellStore().set(
+                sc::CellStoreType& rDestCells = mrDestCol.GetCellStore();
+                maDestPos.miCellPos = rDestCells.set(
                     maDestPos.miCellPos, nTopRow, aCloned.begin(), aCloned.end());
 
+                // Merge adjacent formula cell groups (if applicable).
+                sc::CellStoreType::position_type aPos =
+                    rDestCells.position(maDestPos.miCellPos, nTopRow);
+                maDestPos.miCellPos = aPos.first;
+                mrDestCol.JoinFormulaCellAbove(aPos);
+                size_t nLastRow = nTopRow + nDataSize;
+                if (nLastRow < static_cast<size_t>(MAXROW))
+                {
+                    aPos = rDestCells.position(maDestPos.miCellPos, nLastRow+1);
+                    mrDestCol.JoinFormulaCellAbove(aPos);
+                }
+
                 setDefaultAttrsToDest(nTopRow, nDataSize);
             }
             break;
commit 31d475bcc015b87b9b104cdf2a81faf232a4bf57
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Tue Jul 9 23:27:37 2013 -0400

    Formula cell grouping in CopyUpdated should already be done.
    
    Since it uses the same function object CopyToClipHandler which I added
    grouping support to earlier.
    
    Change-Id: I8964f95041b5170ca1c7fbe073f85fcf77367c9f

diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index f64e80a..cbf45db 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1994,10 +1994,7 @@ void ScColumn::CopyUpdated( const ScColumn& rPosCol, ScColumn& rDestCol ) const
     sc::CellStoreType::const_iterator itPos = maCells.begin();
     sc::SingleColumnSpanSet::SpansType::const_iterator it = aRanges.begin(), itEnd = aRanges.end();
     for (; it != itEnd; ++it)
-    {
         itPos = sc::ParseBlock(itPos, maCells, aFunc, it->mnRow1, it->mnRow2);
-        rDestCol.RegroupFormulaCells(it->mnRow1, it->mnRow2);
-    }
 
     rDestCol.CellStorageModified();
 }


More information about the Libreoffice-commits mailing list