diff options
author | David Tardon <dtardon@redhat.com> | 2016-09-08 14:34:42 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2016-09-09 07:30:30 +0200 |
commit | a66933a890a70f5ff2ac43ccc03c26540ef2ccb3 (patch) | |
tree | eeb47ddbfd93c2dbf616b425984003ebed53386c | |
parent | 91c8bec906cd3c39b9da5629391b151d1bad9a03 (diff) |
use std::unique_ptr
Change-Id: I5128b3e950657f3fe6fc71a8de56c9dd87ac2324
-rw-r--r-- | include/xmloff/xmlnumi.hxx | 3 | ||||
-rw-r--r-- | xmloff/source/style/xmlnumi.cxx | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/include/xmloff/xmlnumi.hxx b/include/xmloff/xmlnumi.hxx index 1b5983e2eb71..f6bf8d61d59b 100644 --- a/include/xmloff/xmlnumi.hxx +++ b/include/xmloff/xmlnumi.hxx @@ -22,6 +22,7 @@ #include <sal/config.h> +#include <memory> #include <vector> #include <com/sun/star/container/XIndexReplace.hpp> @@ -43,7 +44,7 @@ class XMLOFF_DLLPUBLIC SvxXMLListStyleContext css::uno::Reference< css::container::XIndexReplace > xNumRules; - SvxXMLListStyle_Impl *pLevelStyles; + std::unique_ptr<SvxXMLListStyle_Impl> pLevelStyles; sal_Int32 nLevels; bool bConsecutive : 1; diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx index 5feafabda5d5..b087fedf49f2 100644 --- a/xmloff/source/style/xmlnumi.cxx +++ b/xmloff/source/style/xmlnumi.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/io/XOutputStream.hpp> #include <o3tl/any.hxx> +#include <o3tl/make_unique.hxx> #include <rtl/ustrbuf.hxx> #include <osl/diagnose.h> @@ -1026,7 +1027,6 @@ SvxXMLListStyleContext::SvxXMLListStyleContext( SvXMLImport& rImport, , sIsPhysical( "IsPhysical" ) , sNumberingRules( "NumberingRules" ) , sIsContinuousNumbering( "IsContinuousNumbering" ) -, pLevelStyles( nullptr ) , nLevels( 0 ) , bConsecutive( false ) , bOutline( bOutl ) @@ -1044,8 +1044,6 @@ SvxXMLListStyleContext::~SvxXMLListStyleContext() pStyle->ReleaseRef(); } } - - delete pLevelStyles; } @@ -1067,7 +1065,7 @@ SvXMLImportContext *SvxXMLListStyleContext::CreateChildContext( new SvxXMLListLevelStyleContext_Impl( GetImport(), nPrefix, rLocalName, xAttrList ); if( !pLevelStyles ) - pLevelStyles = new SvxXMLListStyle_Impl; + pLevelStyles = o3tl::make_unique<SvxXMLListStyle_Impl>(); pLevelStyles->push_back( pLevelStyle ); pLevelStyle->AddFirstRef(); |