summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2012-07-14 01:20:19 +0200
committerJulien Nabet <serval2412@yahoo.fr>2012-07-14 01:20:19 +0200
commit25608fb92488426b60dabdc1328fd71482a6642e (patch)
tree4de669dd53a9793676757921863334b19bf20e96
parentc48c7560eed91616a33771deae9b4a4d1ccd77e8 (diff)
Check for assignment to self for =operator
Change-Id: I2e537a27d605e564330c897f306f30a12cd7a280
-rw-r--r--sc/source/filter/starcalc/collect.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/sc/source/filter/starcalc/collect.cxx b/sc/source/filter/starcalc/collect.cxx
index fb76f0c45c7c..28d8d8750704 100644
--- a/sc/source/filter/starcalc/collect.cxx
+++ b/sc/source/filter/starcalc/collect.cxx
@@ -148,6 +148,10 @@ sal_uInt16 ScCollection::IndexOf(ScDataObject* pScDataObject) const
ScCollection& ScCollection::operator=( const ScCollection& r )
{
+ // Check for self-assignment
+ if (this == &r)
+ return *this;
+
lcl_DeleteScDataObjects( pItems, nCount );
nCount = r.nCount;