diff options
author | David Tardon <dtardon@redhat.com> | 2016-09-08 14:49:11 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2016-09-09 07:30:30 +0200 |
commit | 655b94643cae76e09d179adc8172790fcff3f881 (patch) | |
tree | c2882e31bc81b3009c666b731189feeaf9e1e6dc /xmloff | |
parent | 4bda91ca86f0036320140178a533c6424b01e43f (diff) |
remove manual memory management
Change-Id: I3f5259ac7cf099a5d03d95a7e9132cc8cb6d0734
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/inc/xmltabi.hxx | 2 | ||||
-rw-r--r-- | xmloff/source/style/xmltabi.cxx | 21 |
2 files changed, 6 insertions, 17 deletions
diff --git a/xmloff/inc/xmltabi.hxx b/xmloff/inc/xmltabi.hxx index 5fb54e0fb548..ecc1b4af282b 100644 --- a/xmloff/inc/xmltabi.hxx +++ b/xmloff/inc/xmltabi.hxx @@ -25,7 +25,7 @@ class SvXMLImport; class SvxXMLTabStopContext_Impl; -typedef std::vector<SvxXMLTabStopContext_Impl *> SvxXMLTabStopArray_Impl; +typedef std::vector<css::uno::Reference<SvxXMLTabStopContext_Impl>> SvxXMLTabStopArray_Impl; class SvxXMLTabStopImportContext : public XMLElementPropertyContext { diff --git a/xmloff/source/style/xmltabi.cxx b/xmloff/source/style/xmltabi.cxx index d922b4b233d5..c2b65577e45a 100644 --- a/xmloff/source/style/xmltabi.cxx +++ b/xmloff/source/style/xmltabi.cxx @@ -179,16 +179,6 @@ SvxXMLTabStopImportContext::SvxXMLTabStopImportContext( SvxXMLTabStopImportContext::~SvxXMLTabStopImportContext() { - if( mpTabStops ) - { - while( !mpTabStops->empty() ) - { - SvxXMLTabStopContext_Impl *pTabStop = mpTabStops->back(); - mpTabStops->pop_back(); - pTabStop->ReleaseRef(); - } - } - delete mpTabStops; } @@ -202,18 +192,17 @@ SvXMLImportContext *SvxXMLTabStopImportContext::CreateChildContext( if( XML_NAMESPACE_STYLE == nPrefix && IsXMLToken( rLocalName, XML_TAB_STOP ) ) { // create new tabstop import context - SvxXMLTabStopContext_Impl *pTabStopContext = + const uno::Reference<SvxXMLTabStopContext_Impl> xTabStopContext{ new SvxXMLTabStopContext_Impl( GetImport(), nPrefix, rLocalName, - xAttrList ); + xAttrList )}; // add new tabstop to array of tabstops if( !mpTabStops ) mpTabStops = new SvxXMLTabStopArray_Impl; - mpTabStops->push_back( pTabStopContext ); - pTabStopContext->AddFirstRef(); + mpTabStops->push_back( xTabStopContext ); - pContext = pTabStopContext; + pContext = xTabStopContext.get(); } else { @@ -235,7 +224,7 @@ void SvxXMLTabStopImportContext::EndElement( ) style::TabStop* pTabStops = aSeq.getArray(); for( sal_uInt16 i=0; i < nCount; i++ ) { - SvxXMLTabStopContext_Impl *pTabStopContext = (*mpTabStops)[i]; + SvxXMLTabStopContext_Impl *pTabStopContext = (*mpTabStops)[i].get(); const style::TabStop& rTabStop = pTabStopContext->getTabStop(); bool bDflt = style::TabAlign_DEFAULT == rTabStop.Alignment; if( !bDflt || 0==i ) |