diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-08-22 14:31:18 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2011-08-23 15:07:03 +0200 |
commit | 742b7f03647a156da118b790da38481a25ef6292 (patch) | |
tree | 7e4d93717ac7f765cbb428e24f71d36ff3f2e1c4 | |
parent | 25bfab5cb9ee801bf1b59abc0aac4f0ae0a013a5 (diff) |
Resolves: fdo#37403 backport collection of operator= fixes
Signed-off-by: Petr Mladek <pmladek@suse.cz>
Signed-off-by: Michael Meeks <michael.meeks@novell.com>
Signed-off-by: Jan Holesovsky <kendy@suse.cz>
-rw-r--r-- | svx/inc/svx/svdorect.hxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdorect.cxx | 30 |
2 files changed, 23 insertions, 9 deletions
diff --git a/svx/inc/svx/svdorect.hxx b/svx/inc/svx/svdorect.hxx index 6114875891..006bec12d1 100644 --- a/svx/inc/svx/svdorect.hxx +++ b/svx/inc/svx/svdorect.hxx @@ -85,6 +85,8 @@ public: SdrRectObj(); SdrRectObj(const Rectangle& rRect); + SdrRectObj& operator=(const SdrRectObj& rCopy); + // Konstruktion eines Textrahmens SdrRectObj(SdrObjKind eNewTextKind); SdrRectObj(SdrObjKind eNewTextKind, const Rectangle& rRect); diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx index f8bb9581fa..fb642bf091 100644 --- a/svx/source/svdraw/svdorect.cxx +++ b/svx/source/svdraw/svdorect.cxx @@ -122,19 +122,30 @@ SdrRectObj::SdrRectObj(SdrObjKind eNewTextKind, const Rectangle& rNewRect, SvStr SdrRectObj::~SdrRectObj() { - if(mpXPoly) - { - delete mpXPoly; - } + delete mpXPoly; +} + +SdrRectObj& SdrRectObj::operator=(const SdrRectObj& rCopy) +{ + if ( this == &rCopy ) + return *this; + + SdrTextObj::operator=( rCopy ); + + delete mpXPoly; + + if ( rCopy.mpXPoly ) + mpXPoly = new XPolygon( *rCopy.mpXPoly ); + else + mpXPoly = NULL; + + return *this; } void SdrRectObj::SetXPolyDirty() { - if(mpXPoly) - { - delete mpXPoly; - mpXPoly = 0L; - } + delete mpXPoly; + mpXPoly = 0L; } bool SdrRectObj::PaintNeedsXPoly(long nEckRad) const @@ -169,6 +180,7 @@ XPolygon SdrRectObj::ImpCalcXPoly(const Rectangle& rRect1, long nRad1) const void SdrRectObj::RecalcXPoly() { + delete mpXPoly; mpXPoly = new XPolygon(ImpCalcXPoly(aRect,GetEckenradius())); } |