summaryrefslogtreecommitdiff
path: root/svx/source/svdraw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-09-05 17:11:31 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-09-06 08:50:35 +0200
commit8494a95f29c74b06cfdf78c6a218ddeba81e3914 (patch)
tree93344094930268bcc7dab40a622ffc4da69d0808 /svx/source/svdraw
parent42eb80c12aae5ae87c218a670d95a82d916f6e2c (diff)
return unique_ptr from ImpConvertMakeObj
Change-Id: I24b53dceb79bd43aed92c8130dc33b637410d231 Reviewed-on: https://gerrit.libreoffice.org/78672 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r--svx/source/svdraw/svdocapt.cxx3
-rw-r--r--svx/source/svdraw/svdocirc.cxx2
-rw-r--r--svx/source/svdraw/svdoedge.cxx3
-rw-r--r--svx/source/svdraw/svdopath.cxx11
-rw-r--r--svx/source/svdraw/svdorect.cxx2
-rw-r--r--svx/source/svdraw/svdotxtr.cxx6
6 files changed, 14 insertions, 13 deletions
diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx
index 2b30aaa52cef..d07dccc980dc 100644
--- a/svx/source/svdraw/svdocapt.cxx
+++ b/svx/source/svdraw/svdocapt.cxx
@@ -43,6 +43,7 @@
#include <svx/svdhdl.hxx>
#include <svx/svdmodel.hxx>
#include <svx/svdocapt.hxx>
+#include <svx/svdopath.hxx>
#include <svx/svdogrp.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdpool.hxx>
@@ -696,7 +697,7 @@ void SdrCaptionObj::RestGeoData(const SdrObjGeoData& rGeo)
SdrObject* SdrCaptionObj::DoConvertToPolyObj(bool bBezier, bool bAddText) const
{
SdrObject* pRect=SdrRectObj::DoConvertToPolyObj(bBezier, bAddText);
- SdrObject* pTail = ImpConvertMakeObj(basegfx::B2DPolyPolygon(aTailPoly.getB2DPolygon()), false, bBezier);
+ SdrObject* pTail = ImpConvertMakeObj(basegfx::B2DPolyPolygon(aTailPoly.getB2DPolygon()), false, bBezier).release();
SdrObject* pRet=(pTail!=nullptr) ? pTail : pRect;
if (pTail!=nullptr && pRect!=nullptr) {
bool bInsRect = true;
diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx
index bc726a64b628..2af9ac8e6d09 100644
--- a/svx/source/svdraw/svdocirc.cxx
+++ b/svx/source/svdraw/svdocirc.cxx
@@ -1151,7 +1151,7 @@ SdrObject* SdrCircObj::DoConvertToPolyObj(bool bBezier, bool bAddText) const
{
const bool bFill(meCircleKind != SdrCircKind::Arc);
const basegfx::B2DPolygon aCircPolygon(ImpCalcXPolyCirc(meCircleKind, maRect, nStartAngle, nEndAngle));
- SdrObject* pRet = ImpConvertMakeObj(basegfx::B2DPolyPolygon(aCircPolygon), bFill, bBezier);
+ SdrObject* pRet = ImpConvertMakeObj(basegfx::B2DPolyPolygon(aCircPolygon), bFill, bBezier).release();
if(bAddText)
{
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index e9d40f0f298a..07512a1e01d5 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -37,6 +37,7 @@
#include <svx/svdhdl.hxx>
#include <svx/svdmodel.hxx>
#include <svx/svdoedge.hxx>
+#include <svx/svdopath.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdpagv.hxx>
#include <svx/svdpool.hxx>
@@ -2404,7 +2405,7 @@ SdrObject* SdrEdgeObj::DoConvertToPolyObj(bool bBezier, bool bAddText) const
{
basegfx::B2DPolyPolygon aPolyPolygon;
aPolyPolygon.append(pEdgeTrack->getB2DPolygon());
- SdrObject* pRet = ImpConvertMakeObj(aPolyPolygon, false, bBezier);
+ SdrObject* pRet = ImpConvertMakeObj(aPolyPolygon, false, bBezier).release();
if(bAddText)
{
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index 9b4e5f060310..e15e2c9e12a8 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -2676,14 +2676,12 @@ SdrObject* SdrPathObj::DoConvertToPolyObj(bool bBezier, bool bAddText) const
const bool bHideContour(
!aText.isDefault() && !aText.getSdrFormTextAttribute().isDefault() && aText.isHideContour());
- SdrObject* pRet = bHideContour ?
- nullptr :
- ImpConvertMakeObj(GetPathPoly(), IsClosed(), bBezier);
+ SdrObject* pRet = nullptr;
- SdrPathObj* pPath = dynamic_cast<SdrPathObj*>( pRet );
-
- if(pPath)
+ if(!bHideContour)
{
+ SdrPathObjUniquePtr pPath = ImpConvertMakeObj(GetPathPoly(), IsClosed(), bBezier);
+
if(pPath->GetPathPoly().areControlPointsUsed())
{
if(!bBezier)
@@ -2700,6 +2698,7 @@ SdrObject* SdrPathObj::DoConvertToPolyObj(bool bBezier, bool bAddText) const
pPath->SetPathPoly(basegfx::utils::expandToCurve(pPath->GetPathPoly()));
}
}
+ pRet = pPath.release();
}
if(bAddText)
diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx
index 3a3d87308f70..6b8c328b154f 100644
--- a/svx/source/svdraw/svdorect.cxx
+++ b/svx/source/svdraw/svdorect.cxx
@@ -571,7 +571,7 @@ SdrObject* SdrRectObj::DoConvertToPolyObj(bool bBezier, bool bAddText) const
// when used with bAddText==false from other converters
if((bAddText && !IsTextFrame()) || HasFill() || HasLine())
{
- pRet = ImpConvertMakeObj(aPolyPolygon, true, bBezier);
+ pRet = ImpConvertMakeObj(aPolyPolygon, true, bBezier).release();
}
if(bAddText)
diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx
index 9bc1b66dc654..6a9050b6cb6c 100644
--- a/svx/source/svdraw/svdotxtr.cxx
+++ b/svx/source/svdraw/svdotxtr.cxx
@@ -430,7 +430,7 @@ bool SdrTextObj::ImpCanConvTextToCurve() const
return !IsOutlText();
}
-SdrObject* SdrTextObj::ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, bool bClosed, bool bBezier) const
+SdrPathObjUniquePtr SdrTextObj::ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, bool bClosed, bool bBezier) const
{
SdrObjKind ePathKind = bClosed ? OBJ_PATHFILL : OBJ_PATHLINE;
basegfx::B2DPolyPolygon aB2DPolyPolygon(rPolyPolygon);
@@ -442,10 +442,10 @@ SdrObject* SdrTextObj::ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPol
ePathKind = bClosed ? OBJ_POLY : OBJ_PLIN;
}
- SdrPathObj* pPathObj = new SdrPathObj(
+ SdrPathObjUniquePtr pPathObj(new SdrPathObj(
getSdrModelFromSdrObject(),
ePathKind,
- aB2DPolyPolygon);
+ aB2DPolyPolygon));
if(bBezier)
{