From b8767d980898d346d9a8a2cc1cbfb040bfc1851a Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 3 Oct 2018 15:35:29 +0200 Subject: pass SvXMLNamespaceMap around using std::unique_ptr Change-Id: Ia5ae67678a508e3df81e72cb84993491e222c528 Reviewed-on: https://gerrit.libreoffice.org/61307 Tested-by: Jenkins Reviewed-by: Noel Grandin --- xmloff/source/transform/TransformerBase.cxx | 6 +++--- xmloff/source/transform/TransformerContext.hxx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'xmloff') diff --git a/xmloff/source/transform/TransformerBase.cxx b/xmloff/source/transform/TransformerBase.cxx index 148230a179b1..03ddddb3f738 100644 --- a/xmloff/source/transform/TransformerBase.cxx +++ b/xmloff/source/transform/TransformerBase.cxx @@ -282,7 +282,7 @@ void SAL_CALL XMLTransformerBase::startElement( const OUString& rName, // Remember old namespace map. if( pRewindMap ) - xContext->PutRewindMap( pRewindMap.release() ); + xContext->PutRewindMap( std::move(pRewindMap) ); // Push context on stack. m_vContexts.push_back( xContext ); @@ -314,7 +314,7 @@ rName m_vContexts.pop_back(); // Get a namespace map to rewind. - SvXMLNamespaceMap *pRewindMap = xContext->TakeRewindMap(); + std::unique_ptr pRewindMap = xContext->TakeRewindMap(); // Delete the current context. xContext = nullptr; @@ -322,7 +322,7 @@ rName // Rewind a namespace map. if( pRewindMap ) { - m_pNamespaceMap.reset( pRewindMap ); + m_pNamespaceMap = std::move( pRewindMap ); } } } diff --git a/xmloff/source/transform/TransformerContext.hxx b/xmloff/source/transform/TransformerContext.hxx index 0a2446f252d4..fe390630a63d 100644 --- a/xmloff/source/transform/TransformerContext.hxx +++ b/xmloff/source/transform/TransformerContext.hxx @@ -41,8 +41,8 @@ class XMLTransformerContext : public ::salhelper::SimpleReferenceObject std::unique_ptr m_xRewindMap; - SvXMLNamespaceMap *TakeRewindMap() { return m_xRewindMap.release(); } - void PutRewindMap( SvXMLNamespaceMap *p ) { m_xRewindMap.reset(p); } + std::unique_ptr TakeRewindMap() { return std::move(m_xRewindMap); } + void PutRewindMap( std::unique_ptr p ) { m_xRewindMap = std::move(p); } protected: -- cgit