diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-08-21 19:33:43 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-22 10:31:42 +0200 |
commit | feb59fca82df3762c4eb3b9ac2c96e9fa387bed1 (patch) | |
tree | 17f6fbe06e87381f0171ac9e92e4e54f59ecb8d8 /svx | |
parent | 3a668a2398fdbe7cfe0176900b26ca6145fb0e8c (diff) |
no need to use unique_ptr for XPolygon
it is already a COW type
Change-Id: I94370d20fbe9d7f6b1bd57f339911a75cbef6484
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120824
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdocirc.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdoedge.cxx | 6 | ||||
-rw-r--r-- | svx/source/svdraw/svdorect.cxx | 7 |
3 files changed, 7 insertions, 10 deletions
diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index 10c56a53db0f..9dc3a1d2d812 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -313,8 +313,8 @@ basegfx::B2DPolygon SdrCircObj::ImpCalcXPolyCirc(const SdrCircKind eCircleKind, void SdrCircObj::RecalcXPoly() { - const basegfx::B2DPolygon aPolyCirc(ImpCalcXPolyCirc(meCircleKind, maRect, nStartAngle, nEndAngle)); - mpXPoly.reset( new XPolygon(aPolyCirc) ); + basegfx::B2DPolygon aPolyCirc(ImpCalcXPolyCirc(meCircleKind, maRect, nStartAngle, nEndAngle)); + mpXPoly = XPolygon(aPolyCirc); } OUString SdrCircObj::TakeObjNameSingul() const diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index 6af9b933c2e5..c48d954c9ace 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -166,7 +166,7 @@ SdrEdgeObj::SdrEdgeObj(SdrModel& rSdrModel) { m_bClosedObj=false; m_bIsEdge=true; - pEdgeTrack.reset(new XPolygon); + pEdgeTrack = XPolygon(); } SdrEdgeObj::SdrEdgeObj(SdrModel& rSdrModel, SdrEdgeObj const & rSource) @@ -181,7 +181,7 @@ SdrEdgeObj::SdrEdgeObj(SdrModel& rSdrModel, SdrEdgeObj const & rSource) { m_bClosedObj = false; m_bIsEdge = true; - pEdgeTrack.reset(new XPolygon(*rSource.pEdgeTrack)); + pEdgeTrack = rSource.pEdgeTrack; bEdgeTrackDirty=rSource.bEdgeTrackDirty; aCon1 =rSource.aCon1; aCon2 =rSource.aCon2; @@ -2469,7 +2469,7 @@ void SdrEdgeObj::NbcSetPoint(const Point& rPnt, sal_uInt32 i) } SdrEdgeObjGeoData::SdrEdgeObjGeoData() - : pEdgeTrack(new XPolygon) + : pEdgeTrack(std::in_place) , bEdgeTrackDirty(false) , bEdgeTrackUserDefined(false) { diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx index cd91f6f06c31..bd3c53bac1ad 100644 --- a/svx/source/svdraw/svdorect.cxx +++ b/svx/source/svdraw/svdorect.cxx @@ -61,10 +61,7 @@ SdrRectObj::SdrRectObj(SdrModel& rSdrModel, SdrRectObj const & rSource) : SdrTextObj(rSdrModel, rSource) { m_bClosedObj=true; - if ( rSource.mpXPoly ) - mpXPoly.reset( new XPolygon( *rSource.mpXPoly ) ); - else - mpXPoly.reset(); + mpXPoly = rSource.mpXPoly; } SdrRectObj::SdrRectObj( @@ -133,7 +130,7 @@ XPolygon SdrRectObj::ImpCalcXPoly(const tools::Rectangle& rRect1, tools::Long nR void SdrRectObj::RecalcXPoly() { - mpXPoly.reset( new XPolygon(ImpCalcXPoly(maRect,GetEckenradius())) ); + mpXPoly = ImpCalcXPoly(maRect,GetEckenradius()); } const XPolygon& SdrRectObj::GetXPoly() const |