From e5246409cc384cd2ba321620e92250f7ddf153af Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 11 Apr 2018 09:56:41 +0200 Subject: return std::unique_ptr from SfxItemSet::Clone Change-Id: Ie747b5c8ff0b82b9f8d268f9a60dbde41b5f022b Reviewed-on: https://gerrit.libreoffice.org/52712 Tested-by: Jenkins Reviewed-by: Noel Grandin --- editeng/source/uno/unotext.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'editeng') diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx index 5ccacadf0637..09805ce0705d 100644 --- a/editeng/source/uno/unotext.cxx +++ b/editeng/source/uno/unotext.cxx @@ -602,7 +602,7 @@ uno::Any SvxUnoTextRangeBase::_getPropertyValue(const OUString& PropertyName, sa const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry(PropertyName ); if( pMap ) { - SfxItemSet* pAttribs = nullptr; + std::unique_ptr pAttribs; if( nPara != -1 ) pAttribs = pForwarder->GetParaAttribs( nPara ).Clone(); else @@ -613,7 +613,6 @@ uno::Any SvxUnoTextRangeBase::_getPropertyValue(const OUString& PropertyName, sa getPropertyValue( pMap, aAny, *pAttribs ); - delete pAttribs; return aAny; } } @@ -886,7 +885,7 @@ uno::Sequence< uno::Any > SvxUnoTextRangeBase::_getPropertyValues( const uno::Se SvxTextForwarder* pForwarder = mpEditSource ? mpEditSource->GetTextForwarder() : nullptr; if( pForwarder ) { - SfxItemSet* pAttribs = nullptr; + std::unique_ptr pAttribs; if( nPara != -1 ) pAttribs = pForwarder->GetParaAttribs( nPara ).Clone(); else @@ -905,9 +904,6 @@ uno::Sequence< uno::Any > SvxUnoTextRangeBase::_getPropertyValues( const uno::Se getPropertyValue( pMap, *pValues, *pAttribs ); } } - - delete pAttribs; - } return aValues; -- cgit