diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-19 09:11:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-19 11:28:41 +0000 |
commit | 968f6a7f0293c08a73807603f3cb294e4b50bad8 (patch) | |
tree | ace3fb5c260c8bbdc3f97c48499b5466f660a68c /xmloff | |
parent | d3ff66999d924e832f8219c65ced0526f1a67f82 (diff) |
new loplugin: useuniqueptr: unotools..xmlscript
Change-Id: I6966d44cff644112dd837adfe7d9c4f459457271
Reviewed-on: https://gerrit.libreoffice.org/33298
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/inc/XMLFootnoteConfigurationImportContext.hxx | 2 | ||||
-rw-r--r-- | xmloff/source/style/XMLFontAutoStylePool.cxx | 1 | ||||
-rw-r--r-- | xmloff/source/style/xmlexppr.cxx | 11 | ||||
-rw-r--r-- | xmloff/source/style/xmlstyle.cxx | 5 | ||||
-rw-r--r-- | xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx | 5 |
5 files changed, 8 insertions, 16 deletions
diff --git a/xmloff/inc/XMLFootnoteConfigurationImportContext.hxx b/xmloff/inc/XMLFootnoteConfigurationImportContext.hxx index 4ea1da3db1ae..fc9c894456c9 100644 --- a/xmloff/inc/XMLFootnoteConfigurationImportContext.hxx +++ b/xmloff/inc/XMLFootnoteConfigurationImportContext.hxx @@ -56,7 +56,7 @@ class XMLFootnoteConfigurationImportContext : public SvXMLStyleContext OUString sBeginNotice; OUString sEndNotice; - SvXMLTokenMap* pAttrTokenMap; + std::unique_ptr<SvXMLTokenMap> pAttrTokenMap; sal_Int16 nOffset; sal_Int16 nNumbering; diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx b/xmloff/source/style/XMLFontAutoStylePool.cxx index 6b4b5a4d59e5..05fa61cc6e8e 100644 --- a/xmloff/source/style/XMLFontAutoStylePool.cxx +++ b/xmloff/source/style/XMLFontAutoStylePool.cxx @@ -143,7 +143,6 @@ XMLFontAutoStylePool::XMLFontAutoStylePool( SvXMLExport& rExp, bool _tryToEmbedF XMLFontAutoStylePool::~XMLFontAutoStylePool() { - delete pPool; } OUString XMLFontAutoStylePool::Add( diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx index 804f788f3720..549e86312dcd 100644 --- a/xmloff/source/style/xmlexppr.cxx +++ b/xmloff/source/style/xmlexppr.cxx @@ -180,7 +180,7 @@ class FilterPropertiesInfo_Impl FilterPropertyInfoList_Impl aPropInfos; FilterPropertyInfoList_Impl::iterator aLastItr; - Sequence <OUString> *pApiNames; + std::unique_ptr<Sequence<OUString>> pApiNames; public: FilterPropertiesInfo_Impl(); @@ -206,7 +206,6 @@ FilterPropertiesInfo_Impl::FilterPropertiesInfo_Impl() : FilterPropertiesInfo_Impl::~FilterPropertiesInfo_Impl() { - delete pApiNames; } void FilterPropertiesInfo_Impl::AddProperty( @@ -216,11 +215,7 @@ void FilterPropertiesInfo_Impl::AddProperty( nCount++; OSL_ENSURE( !pApiNames, "performance warning: API names already retrieved" ); - if( pApiNames ) - { - delete pApiNames; - pApiNames = nullptr; - } + pApiNames.reset(); } const uno::Sequence<OUString>& FilterPropertiesInfo_Impl::GetApiNames() @@ -265,7 +260,7 @@ const uno::Sequence<OUString>& FilterPropertiesInfo_Impl::GetApiNames() } // construct sequence - pApiNames = new Sequence < OUString >( nCount ); + pApiNames.reset( new Sequence < OUString >( nCount ) ); OUString *pNames = pApiNames->getArray(); FilterPropertyInfoList_Impl::iterator aItr = aPropInfos.begin(); FilterPropertyInfoList_Impl::iterator aEnd = aPropInfos.end(); diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx index a08bcc7fc3f5..398832de1dc2 100644 --- a/xmloff/source/style/xmlstyle.cxx +++ b/xmloff/source/style/xmlstyle.cxx @@ -87,8 +87,8 @@ static SvXMLTokenMapEntry aStyleStylesElemTokenMap[] = const SvXMLTokenMap& SvXMLStylesContext::GetStyleStylesElemTokenMap() { if( !mpStyleStylesElemTokenMap ) - mpStyleStylesElemTokenMap = - new SvXMLTokenMap( aStyleStylesElemTokenMap ); + mpStyleStylesElemTokenMap.reset( + new SvXMLTokenMap( aStyleStylesElemTokenMap ) ); return *mpStyleStylesElemTokenMap; } @@ -754,7 +754,6 @@ SvXMLStylesContext::SvXMLStylesContext( SvXMLImport& rImport, sal_uInt16 nPrfx, SvXMLStylesContext::~SvXMLStylesContext() { - delete mpStyleStylesElemTokenMap; } SvXMLImportContext *SvXMLStylesContext::CreateChildContext( sal_uInt16 nPrefix, diff --git a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx index 786c5686309a..55f76951023f 100644 --- a/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx +++ b/xmloff/source/text/XMLFootnoteConfigurationImportContext.cxx @@ -159,7 +159,6 @@ XMLFootnoteConfigurationImportContext::XMLFootnoteConfigurationImportContext( } XMLFootnoteConfigurationImportContext::~XMLFootnoteConfigurationImportContext() { - delete pAttrTokenMap; } enum XMLFtnConfigToken @@ -201,9 +200,9 @@ static const SvXMLTokenMapEntry aTextFieldAttrTokenMap[] = const SvXMLTokenMap& XMLFootnoteConfigurationImportContext::GetFtnConfigAttrTokenMap() { - if (nullptr == pAttrTokenMap) + if (!pAttrTokenMap) { - pAttrTokenMap = new SvXMLTokenMap(aTextFieldAttrTokenMap); + pAttrTokenMap.reset( new SvXMLTokenMap(aTextFieldAttrTokenMap) ); } return *pAttrTokenMap; |