[Libreoffice-commits] .: sc/source

Julien Nabet serval2412 at kemper.freedesktop.org
Fri Jul 13 16:20:45 PDT 2012


 sc/source/filter/starcalc/collect.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 25608fb92488426b60dabdc1328fd71482a6642e
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Jul 14 01:20:19 2012 +0200

    Check for assignment to self for =operator
    
    Change-Id: I2e537a27d605e564330c897f306f30a12cd7a280

diff --git a/sc/source/filter/starcalc/collect.cxx b/sc/source/filter/starcalc/collect.cxx
index fb76f0c..28d8d87 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;


More information about the Libreoffice-commits mailing list