diff options
author | David Tardon <dtardon@redhat.com> | 2016-09-08 14:36:25 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2016-09-09 07:30:30 +0200 |
commit | a363175cfc100664efa218b87a4d9a143014054a (patch) | |
tree | 2ed6b32fc247a91865f6590bc23381e71778750b | |
parent | a66933a890a70f5ff2ac43ccc03c26540ef2ccb3 (diff) |
remove direct memory management
Change-Id: I9c7d53a9cfd5c03e1551626a96cdaa30fc4e546b
-rw-r--r-- | include/xmloff/xmlnumi.hxx | 4 | ||||
-rw-r--r-- | xmloff/source/style/xmlnumi.cxx | 25 |
2 files changed, 6 insertions, 23 deletions
diff --git a/include/xmloff/xmlnumi.hxx b/include/xmloff/xmlnumi.hxx index f6bf8d61d59b..dbe8adc6103f 100644 --- a/include/xmloff/xmlnumi.hxx +++ b/include/xmloff/xmlnumi.hxx @@ -33,7 +33,7 @@ namespace com { namespace sun { namespace star { namespace frame { class XModel; } } } } class SvxXMLListLevelStyleContext_Impl; -typedef std::vector<SvxXMLListLevelStyleContext_Impl *> SvxXMLListStyle_Impl; +typedef std::vector<css::uno::Reference<SvxXMLListLevelStyleContext_Impl>> SvxXMLListStyle_Impl; class XMLOFF_DLLPUBLIC SvxXMLListStyleContext : public SvXMLStyleContext @@ -66,8 +66,6 @@ public: const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList, bool bOutl = false ); - virtual ~SvxXMLListStyleContext(); - virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx index b087fedf49f2..bfec98025425 100644 --- a/xmloff/source/style/xmlnumi.cxx +++ b/xmloff/source/style/xmlnumi.cxx @@ -1033,20 +1033,6 @@ SvxXMLListStyleContext::SvxXMLListStyleContext( SvXMLImport& rImport, { } -SvxXMLListStyleContext::~SvxXMLListStyleContext() -{ - if( pLevelStyles ) - { - while( !pLevelStyles->empty() ) - { - SvxXMLListLevelStyleContext_Impl *pStyle = pLevelStyles->back(); - pLevelStyles->pop_back(); - pStyle->ReleaseRef(); - } - } -} - - SvXMLImportContext *SvxXMLListStyleContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, @@ -1061,15 +1047,14 @@ SvXMLImportContext *SvxXMLListStyleContext::CreateChildContext( IsXMLToken( rLocalName, XML_LIST_LEVEL_STYLE_BULLET ) || IsXMLToken( rLocalName, XML_LIST_LEVEL_STYLE_IMAGE ) ) ) ) { - SvxXMLListLevelStyleContext_Impl *pLevelStyle = + uno::Reference<SvxXMLListLevelStyleContext_Impl> xLevelStyle{ new SvxXMLListLevelStyleContext_Impl( GetImport(), nPrefix, - rLocalName, xAttrList ); + rLocalName, xAttrList )}; if( !pLevelStyles ) pLevelStyles = o3tl::make_unique<SvxXMLListStyle_Impl>(); - pLevelStyles->push_back( pLevelStyle ); - pLevelStyle->AddFirstRef(); + pLevelStyles->push_back( xLevelStyle ); - pContext = pLevelStyle; + pContext = xLevelStyle.get(); } else { @@ -1091,7 +1076,7 @@ void SvxXMLListStyleContext::FillUnoNumRule( for( sal_uInt16 i=0; i < nCount; i++ ) { SvxXMLListLevelStyleContext_Impl *pLevelStyle = - (*pLevelStyles)[i]; + (*pLevelStyles)[i].get(); sal_Int32 nLevel = pLevelStyle->GetLevel(); if( nLevel >= 0 && nLevel < l_nLevels ) { |