Kaydet (Commit) 25608fb9 authored tarafından Julien Nabet's avatar Julien Nabet

Check for assignment to self for =operator

Change-Id: I2e537a27d605e564330c897f306f30a12cd7a280
üst c48c7560
...@@ -148,6 +148,10 @@ sal_uInt16 ScCollection::IndexOf(ScDataObject* pScDataObject) const ...@@ -148,6 +148,10 @@ sal_uInt16 ScCollection::IndexOf(ScDataObject* pScDataObject) const
ScCollection& ScCollection::operator=( const ScCollection& r ) ScCollection& ScCollection::operator=( const ScCollection& r )
{ {
// Check for self-assignment
if (this == &r)
return *this;
lcl_DeleteScDataObjects( pItems, nCount ); lcl_DeleteScDataObjects( pItems, nCount );
nCount = r.nCount; nCount = r.nCount;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment