summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2014-12-15 16:46:00 +0100
committerDavid Tardon <dtardon@redhat.com>2014-12-16 21:40:06 +0100
commitd41656754027da587298f7373770a62b7e7b3f98 (patch)
tree62157172ba5815d21785a893692ebb547d4a9e24 /include
parent2ceba7063c69ae8246efdbf1766002232cd8addf (diff)
protect against self-assignment
Change-Id: Ic7b329fb0d2b5820dac73a9b92a857bb2edd49c8
Diffstat (limited to 'include')
-rw-r--r--include/editeng/numitem.hxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/editeng/numitem.hxx b/include/editeng/numitem.hxx
index 37c9f4ad43c0..664f4601878d 100644
--- a/include/editeng/numitem.hxx
+++ b/include/editeng/numitem.hxx
@@ -336,11 +336,14 @@ SvxNodeNum::SvxNodeNum( sal_uInt8 nLevel, sal_uInt16 nSetVal )
inline SvxNodeNum& SvxNodeNum::operator=( const SvxNodeNum& rCpy )
{
- nSetValue = rCpy.nSetValue;
- nMyLevel = rCpy.nMyLevel;
- bStartNum = rCpy.bStartNum;
+ if ( &rCpy != this)
+ {
+ nSetValue = rCpy.nSetValue;
+ nMyLevel = rCpy.nMyLevel;
+ bStartNum = rCpy.bStartNum;
- memcpy( nLevelVal, rCpy.nLevelVal, sizeof( nLevelVal ) );
+ memcpy( nLevelVal, rCpy.nLevelVal, sizeof( nLevelVal ) );
+ }
return *this;
}