diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-09-21 12:12:33 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-09-22 11:01:53 +0200 |
commit | 442df6cf8345f8029d5a3b470bc4981a5aa2bf20 (patch) | |
tree | 9efa6f2b29f41d79f968d1e8ad2588c323305776 /sw/source/filter/xml/xmlitemi.cxx | |
parent | a411d7729ab2bed05c3c5d22a8cbcf5dde034b91 (diff) |
ofz: don't leak in face of exceptions
Change-Id: Ic15590a13bd3770ee5dd7db76b21c830a4fe73e2
Reviewed-on: https://gerrit.libreoffice.org/42587
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/filter/xml/xmlitemi.cxx')
-rw-r--r-- | sw/source/filter/xml/xmlitemi.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sw/source/filter/xml/xmlitemi.cxx b/sw/source/filter/xml/xmlitemi.cxx index 07e693edd65b..36b7ad9ccc46 100644 --- a/sw/source/filter/xml/xmlitemi.cxx +++ b/sw/source/filter/xml/xmlitemi.cxx @@ -246,7 +246,7 @@ public: const SvXMLUnitConverter& rUnitConv ); virtual ~SwXMLItemSetContext_Impl() override; - virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const ::uno::Reference< xml::sax::XAttributeList > & xAttrList, SfxItemSet& rItemSet, @@ -276,7 +276,7 @@ SwXMLItemSetContext_Impl::~SwXMLItemSetContext_Impl() } } -SvXMLImportContext *SwXMLItemSetContext_Impl::CreateChildContext( +SvXMLImportContextRef SwXMLItemSetContext_Impl::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< xml::sax::XAttributeList > & xAttrList, @@ -284,7 +284,7 @@ SvXMLImportContext *SwXMLItemSetContext_Impl::CreateChildContext( const SvXMLItemMapEntry& rEntry, const SvXMLUnitConverter& _rUnitConv ) { - SvXMLImportContext *pContext = nullptr; + SvXMLImportContextRef xContext; switch( rEntry.nWhichId ) { @@ -294,27 +294,27 @@ SvXMLImportContext *SwXMLItemSetContext_Impl::CreateChildContext( if( SfxItemState::SET == _rItemSet.GetItemState( RES_BACKGROUND, false, &pItem ) ) { - pContext = new SwXMLBrushItemImportContext( + xContext = new SwXMLBrushItemImportContext( GetImport(), nPrefix, rLocalName, xAttrList, _rUnitConv, *static_cast<const SvxBrushItem *>(pItem) ); } else { - pContext = new SwXMLBrushItemImportContext( + xContext = new SwXMLBrushItemImportContext( GetImport(), nPrefix, rLocalName, xAttrList, _rUnitConv, RES_BACKGROUND ); } - xBackground = pContext; + xBackground = xContext; } break; } - if( !pContext ) - pContext = SvXMLItemSetContext::CreateChildContext( nPrefix, rLocalName, + if (!xContext) + xContext = SvXMLItemSetContext::CreateChildContext( nPrefix, rLocalName, xAttrList, _rItemSet, rEntry, _rUnitConv ); - return pContext; + return xContext; } void SwXMLImport::InitItemImport() |