diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-03 15:35:29 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-04 08:16:06 +0200 |
commit | b8767d980898d346d9a8a2cc1cbfb040bfc1851a (patch) | |
tree | 4ccebb024ed86d6f4dcecebdd60ccd0877b32897 /xmloff/source/transform | |
parent | 96a032743339f315ffff13fd8dc9191acffcc636 (diff) |
pass SvXMLNamespaceMap around using std::unique_ptr
Change-Id: Ia5ae67678a508e3df81e72cb84993491e222c528
Reviewed-on: https://gerrit.libreoffice.org/61307
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/transform')
-rw-r--r-- | xmloff/source/transform/TransformerBase.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/transform/TransformerContext.hxx | 4 |
2 files changed, 5 insertions, 5 deletions
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<SvXMLNamespaceMap> 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<SvXMLNamespaceMap> m_xRewindMap; - SvXMLNamespaceMap *TakeRewindMap() { return m_xRewindMap.release(); } - void PutRewindMap( SvXMLNamespaceMap *p ) { m_xRewindMap.reset(p); } + std::unique_ptr<SvXMLNamespaceMap> TakeRewindMap() { return std::move(m_xRewindMap); } + void PutRewindMap( std::unique_ptr<SvXMLNamespaceMap> p ) { m_xRewindMap = std::move(p); } protected: |