summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-01-18 15:55:41 -0500
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-01-18 15:56:38 -0500
commit3fd16d489ef402893ee8df6913e6bd011d61d1fa (patch)
tree3fd03bec0ef15d8ab5fd2e4aa59e1ade64fa2759 /sc
parented26a93b2fc640f5b727ba7dbabc80990438f5b3 (diff)
Try not to leak removed cell instances.
Change-Id: I25da4a34a3e53bc001519194729e613eef167713
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/column.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 8520dc3953fa..01f85fe34d7f 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1216,6 +1216,14 @@ public:
}
};
+struct DeleteCell : std::unary_function<ColEntry, void>
+{
+ void operator() (ColEntry& rEntry)
+ {
+ rEntry.pCell->Delete();
+ }
+};
+
}
void ScColumn::CopyStaticToDocument(SCROW nRow1, SCROW nRow2, ScColumn& rDestCol)
@@ -1230,6 +1238,7 @@ void ScColumn::CopyStaticToDocument(SCROW nRow1, SCROW nRow2, ScColumn& rDestCol
if (it != rDestCol.maItems.end())
{
itEnd = std::find_if(it, rDestCol.maItems.end(), FindAboveRow(nRow2));
+ std::for_each(it, itEnd, DeleteCell());
rDestCol.maItems.erase(it, itEnd);
}