diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-07-09 23:43:37 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-07-11 00:25:35 -0400 |
commit | 39d87d3677f7f2cba84c319f2f6fddfb7bc63598 (patch) | |
tree | a494d6be182b1de2b59f387a55162c7585cec3fe | |
parent | 0ade196676aa285a238168b1e2bfa1fa4ebcd757 (diff) |
Check formula cell group boundaries to optionally merge.
Just in case...
Change-Id: If1feac9f144a8ab7d53823a0625560a499d57b68
-rw-r--r-- | sc/source/core/data/column.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 68795f4fa4b9..ad51473472eb 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; |