summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-02-05 10:38:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-02-06 12:28:27 +0100
commite1f479af4ddde90f9e80b5079ac759cb9f7743a1 (patch)
tree303f50c03182c029a62d123b06a9d6357f180509 /svx
parent7bf0b997366aed67ae1b0cb467113a7be456a765 (diff)
loplugin:useuniqueptr in SdrTextObj
Change-Id: I48f52056dcf17a568266be49f7422fa05be974db Reviewed-on: https://gerrit.libreoffice.org/49274 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdotext.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 0dd6abe5788a..a0cf962a7671 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -178,7 +178,7 @@ SdrTextObj::~SdrTextObj()
rOutl.SetTextObj( nullptr );
}
- delete mpText;
+ mpText.reset();
ImpDeregisterLink();
}
@@ -2113,7 +2113,7 @@ SdrText* SdrTextObj::getActiveText() const
if( !mpText )
return getText( 0 );
else
- return mpText;
+ return mpText.get();
}
/** returns the nth available text. */
@@ -2121,9 +2121,9 @@ SdrText* SdrTextObj::getText( sal_Int32 nIndex ) const
{
if( nIndex == 0 )
{
- if( mpText == nullptr )
- const_cast< SdrTextObj* >(this)->mpText = new SdrText( *const_cast< SdrTextObj* >(this) );
- return mpText;
+ if( !mpText )
+ const_cast< SdrTextObj* >(this)->mpText.reset( new SdrText( *const_cast< SdrTextObj* >(this) ) );
+ return mpText.get();
}
else
{