[Libreoffice-commits] core.git: Branch 'private/kohei/calc-sort-fix' - sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Fri Apr 18 06:11:16 PDT 2014


 sc/source/core/data/cellvalues.cxx |    7 ++++++-
 sc/source/core/data/table3.cxx     |    2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit af09b858439e121c9e965b8b62732ce8cdc80076
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Fri Apr 18 09:11:28 2014 -0400

    Copy formula cells as well.
    
    Change-Id: I5f7e5747336c7104004083e4d23f621a00d4b494

diff --git a/sc/source/core/data/cellvalues.cxx b/sc/source/core/data/cellvalues.cxx
index 38ce4e8..43c251c 100644
--- a/sc/source/core/data/cellvalues.cxx
+++ b/sc/source/core/data/cellvalues.cxx
@@ -10,6 +10,7 @@
 #include <cellvalues.hxx>
 #include <column.hxx>
 #include <cellvalue.hxx>
+#include <sharedformula.hxx>
 
 #include <cassert>
 #include <boost/noncopyable.hpp>
@@ -95,9 +96,13 @@ void CellValues::append( ScRefCellValue& rVal, const CellTextAttr* pAttr )
         case CELLTYPE_FORMULA:
         {
             mpImpl->maCells.resize(n+1);
+            CellStoreType::iterator itBlk = mpImpl->maCells.set(n, rVal.mpFormula->Clone());
 
-            // TODO : Handle this.
+            size_t nOffset = n - itBlk->position;
+            CellStoreType::position_type aPos(itBlk, nOffset);
+            SharedFormulaUtil::joinFormulaCellAbove(aPos);
         }
+        break;
         default:
             bAppendAttr = false;
     }
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 169fa90..4642cf6 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -425,7 +425,7 @@ void ScTable::SortReorder( ScSortInfoArray* pArray, ScProgress* pProgress )
         // a copy before updating the document.
 
         size_t nColCount = aSortParam.nCol2 - aSortParam.nCol1 + 1;
-        boost::ptr_vector<sc::CellValues> aSortedCols;
+        boost::ptr_vector<sc::CellValues> aSortedCols; // storage for copied cells.
         aSortedCols.reserve(nColCount);
         for (size_t i = 0; i < nColCount; ++i)
             aSortedCols.push_back(new sc::CellValues);


More information about the Libreoffice-commits mailing list