summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2016-09-08 14:36:25 +0200
committerDavid Tardon <dtardon@redhat.com>2016-09-09 07:30:30 +0200
commita363175cfc100664efa218b87a4d9a143014054a (patch)
tree2ed6b32fc247a91865f6590bc23381e71778750b /xmloff
parenta66933a890a70f5ff2ac43ccc03c26540ef2ccb3 (diff)
remove direct memory management
Change-Id: I9c7d53a9cfd5c03e1551626a96cdaa30fc4e546b
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/style/xmlnumi.cxx25
1 files changed, 5 insertions, 20 deletions
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 )
{