[Libreoffice-commits] .: Branch 'libreoffice-3-4-3' - svx/inc svx/source
Jan Holesovsky
kendy at kemper.freedesktop.org
Tue Aug 23 06:09:55 PDT 2011
svx/inc/svx/svdorect.hxx | 2 ++
svx/source/svdraw/svdorect.cxx | 30 +++++++++++++++++++++---------
2 files changed, 23 insertions(+), 9 deletions(-)
New commits:
commit 742b7f03647a156da118b790da38481a25ef6292
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Aug 22 14:31:18 2011 +0100
Resolves: fdo#37403 backport collection of operator= fixes
Signed-off-by: Petr Mladek <pmladek at suse.cz>
Signed-off-by: Michael Meeks <michael.meeks at novell.com>
Signed-off-by: Jan Holesovsky <kendy at suse.cz>
diff --git a/svx/inc/svx/svdorect.hxx b/svx/inc/svx/svdorect.hxx
index 6114875..006bec1 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 f8bb958..fb642bf 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()));
}
More information about the Libreoffice-commits
mailing list