From 442df6cf8345f8029d5a3b470bc4981a5aa2bf20 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 21 Sep 2017 12:12:33 +0100 Subject: ofz: don't leak in face of exceptions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic15590a13bd3770ee5dd7db76b21c830a4fe73e2 Reviewed-on: https://gerrit.libreoffice.org/42587 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/source/filter/xml/xmlitemi.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'sw/source/filter/xml/xmlitemi.cxx') 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(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() -- cgit v1.2.3