diff options
author | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2011-07-08 17:28:20 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2011-07-08 17:28:50 +0200 |
commit | b564df24d1ffa1e8962771ba63a3d1cf3c7bd99d (patch) | |
tree | 0ab50861bd5a7735c689cac7d0b284d545dbec78 /svx/source/svdraw | |
parent | d2a1da36fd2e6e569a4737d6ea7ec4beabdca918 (diff) |
fdo#37403: Fixed crasher by using boost::shared_ptr
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r-- | svx/source/svdraw/svdocirc.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdorect.cxx | 25 |
2 files changed, 7 insertions, 20 deletions
diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index 98537d10816b..3ba41752417d 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -291,7 +291,7 @@ basegfx::B2DPolygon SdrCircObj::ImpCalcXPolyCirc(const SdrObjKind eCicrleKind, c void SdrCircObj::RecalcXPoly() { const basegfx::B2DPolygon aPolyCirc(ImpCalcXPolyCirc(meCircleKind, aRect, nStartWink, nEndWink)); - mpXPoly = new XPolygon(aPolyCirc); + mpXPoly.reset( new XPolygon(aPolyCirc) ); } void SdrCircObj::TakeObjNameSingul(XubString& rName) const diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx index e6ecaee1a2bb..e34e389cf146 100644 --- a/svx/source/svdraw/svdorect.cxx +++ b/svx/source/svdraw/svdorect.cxx @@ -78,21 +78,18 @@ sdr::contact::ViewContact* SdrRectObj::CreateObjectSpecificViewContact() TYPEINIT1(SdrRectObj,SdrTextObj); SdrRectObj::SdrRectObj() -: mpXPoly(0L) { bClosedObj=sal_True; } SdrRectObj::SdrRectObj(const Rectangle& rRect) -: SdrTextObj(rRect), - mpXPoly(NULL) +: SdrTextObj(rRect) { bClosedObj=sal_True; } SdrRectObj::SdrRectObj(SdrObjKind eNewTextKind) -: SdrTextObj(eNewTextKind), - mpXPoly(NULL) +: SdrTextObj(eNewTextKind) { DBG_ASSERT(eTextKind==OBJ_TEXT || eTextKind==OBJ_TEXTEXT || eTextKind==OBJ_OUTLINETEXT || eTextKind==OBJ_TITLETEXT, @@ -101,8 +98,7 @@ SdrRectObj::SdrRectObj(SdrObjKind eNewTextKind) } SdrRectObj::SdrRectObj(SdrObjKind eNewTextKind, const Rectangle& rRect) -: SdrTextObj(eNewTextKind,rRect), - mpXPoly(NULL) +: SdrTextObj(eNewTextKind,rRect) { DBG_ASSERT(eTextKind==OBJ_TEXT || eTextKind==OBJ_TEXTEXT || eTextKind==OBJ_OUTLINETEXT || eTextKind==OBJ_TITLETEXT, @@ -111,8 +107,7 @@ SdrRectObj::SdrRectObj(SdrObjKind eNewTextKind, const Rectangle& rRect) } SdrRectObj::SdrRectObj(SdrObjKind eNewTextKind, const Rectangle& rNewRect, SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat) -: SdrTextObj(eNewTextKind,rNewRect,rInput,rBaseURL,eFormat), - mpXPoly(NULL) +: SdrTextObj(eNewTextKind,rNewRect,rInput,rBaseURL,eFormat) { DBG_ASSERT(eTextKind==OBJ_TEXT || eTextKind==OBJ_TEXTEXT || eTextKind==OBJ_OUTLINETEXT || eTextKind==OBJ_TITLETEXT, @@ -122,19 +117,11 @@ SdrRectObj::SdrRectObj(SdrObjKind eNewTextKind, const Rectangle& rNewRect, SvStr SdrRectObj::~SdrRectObj() { - if(mpXPoly) - { - delete mpXPoly; - } } void SdrRectObj::SetXPolyDirty() { - if(mpXPoly) - { - delete mpXPoly; - mpXPoly = 0L; - } + mpXPoly.reset(); } bool SdrRectObj::PaintNeedsXPoly(long nEckRad) const @@ -169,7 +156,7 @@ XPolygon SdrRectObj::ImpCalcXPoly(const Rectangle& rRect1, long nRad1) const void SdrRectObj::RecalcXPoly() { - mpXPoly = new XPolygon(ImpCalcXPoly(aRect,GetEckenradius())); + mpXPoly.reset( new XPolygon(ImpCalcXPoly(aRect,GetEckenradius())) ); } const XPolygon& SdrRectObj::GetXPoly() const |