summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-07-09 22:56:30 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-07-11 00:25:34 -0400
commit4e10b2e26f4ac5e2a5ff28e2e3a1eedbf5f8ca61 (patch)
tree64d0a67f0ce68bcc6c5276faf9c243b28f9f2832 /sc
parenteca428bf03ed71279c985ce6862570f7c8ebacb3 (diff)
Grouping of formula cells during undo.
Change-Id: I57693eee34a073cd3f39fdd4f5a74eafb12c9dc7
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/column.cxx15
1 files changed, 6 insertions, 9 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index c69a3c17fc57..7ce2d5befcbe 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1572,7 +1572,6 @@ class CopyAsLinkHandler
sc::ColumnBlockPosition maDestPos;
sc::ColumnBlockPosition* mpDestPos;
sal_uInt16 mnCopyFlags;
- std::vector<ScFormulaCell*> maCellBuffer;
void setDefaultAttrToDest(size_t nRow)
{
@@ -1602,13 +1601,12 @@ class CopyAsLinkHandler
{
size_t nTopRow = aNode.position + nOffset;
- maCellBuffer.clear();
- maCellBuffer.reserve(nDataSize);
-
for (size_t i = 0; i < nDataSize; ++i)
- maCellBuffer.push_back(createRefCell(nTopRow + i));
+ {
+ SCROW nRow = nTopRow + i;
+ mrDestCol.SetFormulaCell(maDestPos, nRow, createRefCell(nRow));
+ }
- maDestPos.miCellPos = mrDestCol.GetCellStore().set(maDestPos.miCellPos, nTopRow, maCellBuffer.begin(), maCellBuffer.end());
setDefaultAttrsToDest(nTopRow, nDataSize);
}
@@ -1727,7 +1725,7 @@ class CopyByCloneHandler
// Clone as formula cell.
ScFormulaCell* pCell = new ScFormulaCell(rSrcCell, mrDestCol.GetDoc(), aDestPos);
pCell->SetDirtyVar();
- maDestPos.miCellPos = mrDestCol.GetCellStore().set(maDestPos.miCellPos, nRow, pCell);
+ mrDestCol.SetFormulaCell(maDestPos, nRow, pCell);
setDefaultAttrToDest(nRow);
return;
}
@@ -1743,8 +1741,7 @@ class CopyByCloneHandler
// error codes are cloned with values
ScFormulaCell* pErrCell = new ScFormulaCell(&mrDestCol.GetDoc(), aDestPos);
pErrCell->SetErrCode(nErr);
- maDestPos.miCellPos = mrDestCol.GetCellStore().set(
- maDestPos.miCellPos, nRow, new ScFormulaCell(rSrcCell, mrDestCol.GetDoc(), aDestPos));
+ mrDestCol.SetFormulaCell(maDestPos, nRow, pErrCell);
setDefaultAttrToDest(nRow);
return;
}