diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-11-11 12:33:35 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-11-11 17:03:11 +0000 |
commit | f731296e0ce7c4a0be77fdcba0c2578147211dfa (patch) | |
tree | 24a719afe7dd39059f83854595c0438925ccb4a7 /editeng | |
parent | make it more typical copy ctor (diff) | |
download | core-f731296e0ce7c4a0be77fdcba0c2578147211dfa.tar.gz core-f731296e0ce7c4a0be77fdcba0c2578147211dfa.zip |
check for self-assignment
Change-Id: I74eb934d19c0b511870e5a675917ca4baaf768cc
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/items/frmitems.cxx | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 6bfcbaa1bfd6..ec383ebce144 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -3674,14 +3674,17 @@ bool SvxBrushItem::GetPresentation SvxBrushItem& SvxBrushItem::operator=(const SvxBrushItem& rItem) { - aColor = rItem.aColor; - nShadingValue = rItem.nShadingValue; - xGraphicObject.reset(rItem.xGraphicObject ? new GraphicObject(*rItem.xGraphicObject) : nullptr); - nGraphicTransparency = rItem.nGraphicTransparency; - maStrLink = rItem.maStrLink; - maStrFilter = rItem.maStrFilter; - eGraphicPos = rItem.eGraphicPos; - bLoadAgain = rItem.bLoadAgain; + if (&rItem != this) + { + aColor = rItem.aColor; + nShadingValue = rItem.nShadingValue; + xGraphicObject.reset(rItem.xGraphicObject ? new GraphicObject(*rItem.xGraphicObject) : nullptr); + nGraphicTransparency = rItem.nGraphicTransparency; + maStrLink = rItem.maStrLink; + maStrFilter = rItem.maStrFilter; + eGraphicPos = rItem.eGraphicPos; + bLoadAgain = rItem.bLoadAgain; + } return *this; } |