summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-04-18 09:11:28 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-04-23 21:08:20 -0400
commit4004ceeb39e14c6ef1cfef7925623ccfa02ecb35 (patch)
tree0bdf3395399a415ee783a9c70538aa23c63dbfa7 /sc
parent7fa63df57000b51ccc25a8ae62159521f727c834 (diff)
Copy formula cells as well.
Change-Id: I5f7e5747336c7104004083e4d23f621a00d4b494
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/cellvalues.cxx7
-rw-r--r--sc/source/core/data/table3.cxx2
2 files changed, 7 insertions, 2 deletions
diff --git a/sc/source/core/data/cellvalues.cxx b/sc/source/core/data/cellvalues.cxx
index 38ce4e8631e1..43c251cc9a91 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 169fa905a080..4642cf69dddb 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);