summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-11-11 12:01:11 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-11-11 16:13:31 +0000
commit763c47724d0ed4be5bbfeea7da737fdc50b3e80d (patch)
tree9b34c945cbd3537e4d9d3e1a148a32e4f1322f09 /editeng
parent0220020a620a69eae493070ddd88cc74825400b1 (diff)
make this operator= a little less crazy
if SetGraphicPos was called with GPOS_NONE then xGraphicObject, maStrLink and maStrFilter are in a suitable state to copy to get the same results as explicitly forced here Change-Id: Id072590e92e0c083a3cbc443db0e85d9dbfa73f0 Reviewed-on: https://gerrit.libreoffice.org/30780 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/items/frmitems.cxx22
1 files changed, 4 insertions, 18 deletions
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index c98e34ed2e58..94d0eb8bcd09 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -3672,29 +3672,15 @@ bool SvxBrushItem::GetPresentation
SvxBrushItem& SvxBrushItem::operator=(const SvxBrushItem& rItem)
{
aColor = rItem.aColor;
- eGraphicPos = rItem.eGraphicPos;
-
- xGraphicObject.reset();
- maStrLink.clear();
- maStrFilter.clear();
-
- if ( GPOS_NONE != eGraphicPos )
- {
- maStrLink = rItem.maStrLink;
- maStrFilter = rItem.maStrFilter;
- if (rItem.xGraphicObject)
- {
- xGraphicObject.reset(new GraphicObject(*rItem.xGraphicObject));
- }
- }
-
nShadingValue = rItem.nShadingValue;
-
+ xGraphicObject.reset(rItem.xGraphicObject ? new GraphicObject(*rItem.xGraphicObject) : nullptr);
nGraphicTransparency = rItem.nGraphicTransparency;
+ maStrLink = rItem.maStrLink;
+ maStrFilter = rItem.maStrFilter;
+ eGraphicPos = rItem.eGraphicPos;
return *this;
}
-
bool SvxBrushItem::operator==( const SfxPoolItem& rAttr ) const
{
DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" );