summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdograf.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-09-06 09:14:06 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-09-06 12:50:57 +0200
commitfc161dc07cafda54ebdabd4c66dfd6528cc11813 (patch)
tree81b5ccfca3793741ac74a4591f0b6605986eabe3 /svx/source/svdraw/svdograf.cxx
parentdc79dc76f18148296ae18ed7251cf61505e25d44 (diff)
use unique_ptr in DoConvertToPolyObj
Change-Id: Ia7f9ff4d8f7b9834b6634e5c126bd65014dacf19 Reviewed-on: https://gerrit.libreoffice.org/78684 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/svdraw/svdograf.cxx')
-rw-r--r--svx/source/svdraw/svdograf.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 306f0543ab97..7e14a6d3bdd9 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -917,7 +917,7 @@ sal_Int32 SdrGrafObj::getEmbeddedPageNumber() const
return mpGraphicObject->GetGraphic().getPageNumber();
}
-SdrObject* SdrGrafObj::DoConvertToPolyObj(bool bBezier, bool bAddText ) const
+SdrObjectUniquePtr SdrGrafObj::DoConvertToPolyObj(bool bBezier, bool bAddText ) const
{
SdrObject* pRetval = nullptr;
GraphicType aGraphicType(GetGraphicType());
@@ -964,7 +964,7 @@ SdrObject* SdrGrafObj::DoConvertToPolyObj(bool bBezier, bool bAddText ) const
if( pRetval )
{
SdrObject* pHalfDone = pRetval;
- pRetval = pHalfDone->DoConvertToPolyObj(bBezier, bAddText);
+ pRetval = pRetval->DoConvertToPolyObj(bBezier, bAddText).release();
SdrObject::Free( pHalfDone ); // resulting object is newly created
if( pRetval )
@@ -987,7 +987,7 @@ SdrObject* SdrGrafObj::DoConvertToPolyObj(bool bBezier, bool bAddText ) const
}
// #i118485# convert line and fill
- SdrObject* pLineFill = SdrRectObj::DoConvertToPolyObj(bBezier, false);
+ SdrObjectUniquePtr pLineFill = SdrRectObj::DoConvertToPolyObj(bBezier, false);
if(pLineFill)
{
@@ -1002,11 +1002,11 @@ SdrObject* SdrGrafObj::DoConvertToPolyObj(bool bBezier, bool bAddText ) const
pGrp->GetSubList()->NbcInsertObject(pRetval);
}
- pGrp->GetSubList()->NbcInsertObject(pLineFill, 0);
+ pGrp->GetSubList()->NbcInsertObject(pLineFill.release(), 0);
}
else
{
- pRetval = pLineFill;
+ pRetval = pLineFill.release();
}
}
@@ -1015,7 +1015,7 @@ SdrObject* SdrGrafObj::DoConvertToPolyObj(bool bBezier, bool bAddText ) const
case GraphicType::Bitmap:
{
// create basic object and add fill
- pRetval = SdrRectObj::DoConvertToPolyObj(bBezier, bAddText);
+ pRetval = SdrRectObj::DoConvertToPolyObj(bBezier, bAddText).release();
// save bitmap as an attribute
if(pRetval)
@@ -1035,12 +1035,12 @@ SdrObject* SdrGrafObj::DoConvertToPolyObj(bool bBezier, bool bAddText ) const
case GraphicType::NONE:
case GraphicType::Default:
{
- pRetval = SdrRectObj::DoConvertToPolyObj(bBezier, bAddText);
+ pRetval = SdrRectObj::DoConvertToPolyObj(bBezier, bAddText).release();
break;
}
}
- return pRetval;
+ return SdrObjectUniquePtr(pRetval);
}
void SdrGrafObj::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )