[Libreoffice-commits] .: sc/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Jan 18 12:55:12 PST 2013
sc/source/core/data/column.cxx | 9 +++++++++
1 file changed, 9 insertions(+)
New commits:
commit 3fd16d489ef402893ee8df6913e6bd011d61d1fa
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Fri Jan 18 15:55:41 2013 -0500
Try not to leak removed cell instances.
Change-Id: I25da4a34a3e53bc001519194729e613eef167713
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 8520dc3..01f85fe 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);
}
More information about the Libreoffice-commits
mailing list