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 /xmloff/source/script | |
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 'xmloff/source/script')
-rw-r--r-- | xmloff/source/script/XMLEventsImportContext.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/script/xmlbasici.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/script/xmlbasici.hxx | 4 | ||||
-rw-r--r-- | xmloff/source/script/xmlscripti.cxx | 28 |
4 files changed, 19 insertions, 19 deletions
diff --git a/xmloff/source/script/XMLEventsImportContext.cxx b/xmloff/source/script/XMLEventsImportContext.cxx index 07ffa2f048b0..3a6e988634b0 100644 --- a/xmloff/source/script/XMLEventsImportContext.cxx +++ b/xmloff/source/script/XMLEventsImportContext.cxx @@ -86,7 +86,7 @@ void XMLEventsImportContext::EndElement() // nothing to be done } -SvXMLImportContext* XMLEventsImportContext::CreateChildContext( +SvXMLImportContextRef XMLEventsImportContext::CreateChildContext( sal_uInt16 p_nPrefix, const OUString& rLocalName, const Reference<XAttributeList> & xAttrList ) diff --git a/xmloff/source/script/xmlbasici.cxx b/xmloff/source/script/xmlbasici.cxx index 8e884c9c211b..a9ab4dae7a64 100644 --- a/xmloff/source/script/xmlbasici.cxx +++ b/xmloff/source/script/xmlbasici.cxx @@ -45,7 +45,7 @@ XMLBasicImportContext::~XMLBasicImportContext() { } -SvXMLImportContext* XMLBasicImportContext::CreateChildContext( +SvXMLImportContextRef XMLBasicImportContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< xml::sax::XAttributeList >& ) { @@ -116,7 +116,7 @@ XMLBasicImportChildContext::~XMLBasicImportChildContext() { } -SvXMLImportContext* XMLBasicImportChildContext::CreateChildContext( +SvXMLImportContextRef XMLBasicImportChildContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< xml::sax::XAttributeList >& ) { diff --git a/xmloff/source/script/xmlbasici.hxx b/xmloff/source/script/xmlbasici.hxx index e74e8d737b59..ac85c18fc372 100644 --- a/xmloff/source/script/xmlbasici.hxx +++ b/xmloff/source/script/xmlbasici.hxx @@ -38,7 +38,7 @@ public: virtual ~XMLBasicImportContext() override; - virtual SvXMLImportContext* CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList >& rxAttrList ) override; virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& rxAttrList ) override; @@ -61,7 +61,7 @@ public: virtual ~XMLBasicImportChildContext() override; - virtual SvXMLImportContext* CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override; virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override; diff --git a/xmloff/source/script/xmlscripti.cxx b/xmloff/source/script/xmlscripti.cxx index 31bb0398c45a..4844fcb04da4 100644 --- a/xmloff/source/script/xmlscripti.cxx +++ b/xmloff/source/script/xmlscripti.cxx @@ -50,7 +50,7 @@ public: const css::uno::Reference< css::frame::XModel>& rxModel, const OUString& rLanguage ); - virtual SvXMLImportContext* CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, + virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override; virtual void EndElement() override; @@ -65,11 +65,11 @@ XMLScriptChildContext::XMLScriptChildContext( SvXMLImport& rImport, sal_uInt16 n { } -SvXMLImportContext* XMLScriptChildContext::CreateChildContext( +SvXMLImportContextRef XMLScriptChildContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference< xml::sax::XAttributeList >& xAttrList ) { - SvXMLImportContext* pContext = nullptr; + SvXMLImportContextRef xContext; if ( m_xDocumentScripts.is() ) { // document supports embedding scripts/macros @@ -77,13 +77,13 @@ SvXMLImportContext* XMLScriptChildContext::CreateChildContext( aBasic += ":Basic"; if ( m_aLanguage == aBasic && nPrefix == XML_NAMESPACE_OOO && IsXMLToken( rLocalName, XML_LIBRARIES ) ) - pContext = new XMLBasicImportContext( GetImport(), nPrefix, rLocalName, m_xModel ); + xContext = new XMLBasicImportContext( GetImport(), nPrefix, rLocalName, m_xModel ); } - if ( !pContext ) - pContext = SvXMLImportContext::CreateChildContext( nPrefix, rLocalName, xAttrList ); + if (!xContext) + xContext = SvXMLImportContext::CreateChildContext( nPrefix, rLocalName, xAttrList ); - return pContext; + return xContext; } void XMLScriptChildContext::EndElement() @@ -103,18 +103,18 @@ XMLScriptContext::~XMLScriptContext() { } -SvXMLImportContext* XMLScriptContext::CreateChildContext( +SvXMLImportContextRef XMLScriptContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLName, const Reference<XAttributeList>& xAttrList ) { - SvXMLImportContext* pContext = nullptr; + SvXMLImportContextRef xContext; if ( nPrefix == XML_NAMESPACE_OFFICE ) { if ( IsXMLToken( rLName, XML_EVENT_LISTENERS ) ) { Reference< XEventsSupplier> xSupplier( GetImport().GetModel(), UNO_QUERY ); - pContext = new XMLEventsImportContext( GetImport(), nPrefix, rLName, xSupplier ); + xContext = new XMLEventsImportContext( GetImport(), nPrefix, rLName, xSupplier ); } else if ( IsXMLToken( rLName, XML_SCRIPT ) ) { @@ -133,16 +133,16 @@ SvXMLImportContext* XMLScriptContext::CreateChildContext( aMedDescr[nNewLen-1].Value <<= true; m_xModel->attachResource( m_xModel->getURL(), aMedDescr ); - pContext = new XMLScriptChildContext( GetImport(), nPrefix, rLName, m_xModel, aLanguage ); + xContext = new XMLScriptChildContext( GetImport(), nPrefix, rLName, m_xModel, aLanguage ); } } } } - if ( !pContext ) - pContext = SvXMLImportContext::CreateChildContext( nPrefix, rLName, xAttrList); + if (!xContext) + xContext = SvXMLImportContext::CreateChildContext( nPrefix, rLName, xAttrList); - return pContext; + return xContext; } void XMLScriptContext::EndElement() |