diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-11 09:56:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-11 14:08:27 +0200 |
commit | e5246409cc384cd2ba321620e92250f7ddf153af (patch) | |
tree | eae4b87b9df1918bc69e081d87449a34ef483a99 /editeng/source/uno/unotext.cxx | |
parent | 1c0e591accda7669bec9ccfc23977ce3f7386930 (diff) |
return std::unique_ptr from SfxItemSet::Clone
Change-Id: Ie747b5c8ff0b82b9f8d268f9a60dbde41b5f022b
Reviewed-on: https://gerrit.libreoffice.org/52712
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng/source/uno/unotext.cxx')
-rw-r--r-- | editeng/source/uno/unotext.cxx | 8 |
1 files changed, 2 insertions, 6 deletions
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<SfxItemSet> 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<SfxItemSet> 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; |