summaryrefslogtreecommitdiff
path: root/xmloff/source/style
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-19 09:11:39 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-19 11:28:41 +0000
commit968f6a7f0293c08a73807603f3cb294e4b50bad8 (patch)
treeace3fb5c260c8bbdc3f97c48499b5466f660a68c /xmloff/source/style
parentd3ff66999d924e832f8219c65ced0526f1a67f82 (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/source/style')
-rw-r--r--xmloff/source/style/XMLFontAutoStylePool.cxx1
-rw-r--r--xmloff/source/style/xmlexppr.cxx11
-rw-r--r--xmloff/source/style/xmlstyle.cxx5
3 files changed, 5 insertions, 12 deletions
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,