summaryrefslogtreecommitdiff
path: root/cui/source/tabpages/tplneend.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 /cui/source/tabpages/tplneend.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 'cui/source/tabpages/tplneend.cxx')
-rw-r--r--cui/source/tabpages/tplneend.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx
index eb73de028838..7901503d2d9e 100644
--- a/cui/source/tabpages/tplneend.cxx
+++ b/cui/source/tabpages/tplneend.cxx
@@ -122,12 +122,11 @@ void SvxLineEndDefTabPage::Construct()
{
SdrObjTransformInfoRec aInfoRec;
pPolyObj->TakeObjInfo( aInfoRec );
- SdrObject* pNewObj = nullptr;
+ SdrObjectUniquePtr pNewObj;
if( aInfoRec.bCanConvToPath )
pNewObj = pPolyObj->ConvertToPolyObj( true, false );
- bCreateArrowPossible = nullptr != dynamic_cast<const SdrPathObj*>( pNewObj);
- SdrObject::Free( pNewObj );
+ bCreateArrowPossible = nullptr != dynamic_cast<const SdrPathObj*>( pNewObj.get());
}
if( !bCreateArrowPossible )
@@ -355,7 +354,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl, weld::Button&, void)
if( pPolyObj )
{
const SdrObject* pNewObj;
- SdrObject* pConvPolyObj = nullptr;
+ SdrObjectUniquePtr pConvPolyObj;
if( nullptr != dynamic_cast<const SdrPathObj*>( pPolyObj) )
{
@@ -368,7 +367,8 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl, weld::Button&, void)
if( aInfoRec.bCanConvToPath )
{
- pNewObj = pConvPolyObj = pPolyObj->ConvertToPolyObj( true, false );
+ pConvPolyObj = pPolyObj->ConvertToPolyObj( true, false );
+ pNewObj = pConvPolyObj.get();
if( !pNewObj || nullptr == dynamic_cast<const SdrPathObj*>( pNewObj) )
return; // cancel, additional safety, which
@@ -383,7 +383,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl, weld::Button&, void)
// normalize
aNewPolyPolygon.transform(basegfx::utils::createTranslateB2DHomMatrix( -aNewRange.getMinX(), -aNewRange.getMinY()));
- SdrObject::Free( pConvPolyObj );
+ pConvPolyObj.reset();
OUString aNewName(SvxResId(RID_SVXSTR_LINEEND));
OUString aDesc(CuiResId(RID_SVXSTR_DESC_LINEEND));