diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-09-06 09:14:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-09-06 12:50:57 +0200 |
commit | fc161dc07cafda54ebdabd4c66dfd6528cc11813 (patch) | |
tree | 81b5ccfca3793741ac74a4591f0b6605986eabe3 /svx/source/customshapes | |
parent | dc79dc76f18148296ae18ed7251cf61505e25d44 (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/customshapes')
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShape3d.cxx | 5 | ||||
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShapeEngine.cxx | 7 |
2 files changed, 4 insertions, 8 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx index 2d53139baea4..339f99fd3b59 100644 --- a/svx/source/customshapes/EnhancedCustomShape3d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx @@ -459,11 +459,10 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( } else { - SdrObject* pNewObj = pNext->ConvertToPolyObj( false, false ); - SdrPathObj* pPath = dynamic_cast<SdrPathObj*>( pNewObj ); + SdrObjectUniquePtr pNewObj = pNext->ConvertToPolyObj( false, false ); + SdrPathObj* pPath = dynamic_cast<SdrPathObj*>( pNewObj.get() ); if ( pPath ) aPolyPoly = pPath->GetPathPoly(); - SdrObject::Free( pNewObj ); } if( aPolyPoly.count() ) diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx index 95cb473a86a2..a7b08f99afc4 100644 --- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx @@ -459,7 +459,6 @@ drawing::PolyPolygonBezierCoords SAL_CALL EnhancedCustomShapeEngine::getLineGeom while ( aIter.IsMore() ) { - SdrObject* pNewObj = nullptr; basegfx::B2DPolyPolygon aPP; const SdrObject* pNext = aIter.Next(); @@ -469,16 +468,14 @@ drawing::PolyPolygonBezierCoords SAL_CALL EnhancedCustomShapeEngine::getLineGeom } else { - pNewObj = pNext->ConvertToPolyObj( false, false ); - SdrPathObj* pPath = dynamic_cast<SdrPathObj*>( pNewObj ); + SdrObjectUniquePtr pNewObj = pNext->ConvertToPolyObj( false, false ); + SdrPathObj* pPath = dynamic_cast<SdrPathObj*>( pNewObj.get() ); if ( pPath ) aPP = pPath->GetPathPoly(); } if ( aPP.count() ) aPolyPolygon.append(aPP); - - SdrObject::Free( pNewObj ); } SdrObject::Free( pObj ); basegfx::utils::B2DPolyPolygonToUnoPolyPolygonBezierCoords( aPolyPolygon, |