From 4004ceeb39e14c6ef1cfef7925623ccfa02ecb35 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 18 Apr 2014 09:11:28 -0400 Subject: Copy formula cells as well. Change-Id: I5f7e5747336c7104004083e4d23f621a00d4b494 --- sc/source/core/data/cellvalues.cxx | 7 ++++++- sc/source/core/data/table3.cxx | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'sc') 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 #include #include +#include #include #include @@ -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 aSortedCols; + boost::ptr_vector aSortedCols; // storage for copied cells. aSortedCols.reserve(nColCount); for (size_t i = 0; i < nColCount; ++i) aSortedCols.push_back(new sc::CellValues); -- cgit