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>
This commit is contained in:
@@ -3672,29 +3672,15 @@ bool SvxBrushItem::GetPresentation
|
|||||||
SvxBrushItem& SvxBrushItem::operator=(const SvxBrushItem& rItem)
|
SvxBrushItem& SvxBrushItem::operator=(const SvxBrushItem& rItem)
|
||||||
{
|
{
|
||||||
aColor = rItem.aColor;
|
aColor = rItem.aColor;
|
||||||
eGraphicPos = rItem.eGraphicPos;
|
nShadingValue = rItem.nShadingValue;
|
||||||
|
xGraphicObject.reset(rItem.xGraphicObject ? new GraphicObject(*rItem.xGraphicObject) : nullptr);
|
||||||
xGraphicObject.reset();
|
nGraphicTransparency = rItem.nGraphicTransparency;
|
||||||
maStrLink.clear();
|
|
||||||
maStrFilter.clear();
|
|
||||||
|
|
||||||
if ( GPOS_NONE != eGraphicPos )
|
|
||||||
{
|
|
||||||
maStrLink = rItem.maStrLink;
|
maStrLink = rItem.maStrLink;
|
||||||
maStrFilter = rItem.maStrFilter;
|
maStrFilter = rItem.maStrFilter;
|
||||||
if (rItem.xGraphicObject)
|
eGraphicPos = rItem.eGraphicPos;
|
||||||
{
|
|
||||||
xGraphicObject.reset(new GraphicObject(*rItem.xGraphicObject));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
nShadingValue = rItem.nShadingValue;
|
|
||||||
|
|
||||||
nGraphicTransparency = rItem.nGraphicTransparency;
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SvxBrushItem::operator==( const SfxPoolItem& rAttr ) const
|
bool SvxBrushItem::operator==( const SfxPoolItem& rAttr ) const
|
||||||
{
|
{
|
||||||
DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" );
|
DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" );
|
||||||
|
Reference in New Issue
Block a user