Kaydet (Commit) b8767d98 authored tarafından Noel Grandin's avatar Noel Grandin

pass SvXMLNamespaceMap around using std::unique_ptr

Change-Id: Ia5ae67678a508e3df81e72cb84993491e222c528
Reviewed-on: https://gerrit.libreoffice.org/61307
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 96a03274
...@@ -282,7 +282,7 @@ void SAL_CALL XMLTransformerBase::startElement( const OUString& rName, ...@@ -282,7 +282,7 @@ void SAL_CALL XMLTransformerBase::startElement( const OUString& rName,
// Remember old namespace map. // Remember old namespace map.
if( pRewindMap ) if( pRewindMap )
xContext->PutRewindMap( pRewindMap.release() ); xContext->PutRewindMap( std::move(pRewindMap) );
// Push context on stack. // Push context on stack.
m_vContexts.push_back( xContext ); m_vContexts.push_back( xContext );
...@@ -314,7 +314,7 @@ rName ...@@ -314,7 +314,7 @@ rName
m_vContexts.pop_back(); m_vContexts.pop_back();
// Get a namespace map to rewind. // Get a namespace map to rewind.
SvXMLNamespaceMap *pRewindMap = xContext->TakeRewindMap(); std::unique_ptr<SvXMLNamespaceMap> pRewindMap = xContext->TakeRewindMap();
// Delete the current context. // Delete the current context.
xContext = nullptr; xContext = nullptr;
...@@ -322,7 +322,7 @@ rName ...@@ -322,7 +322,7 @@ rName
// Rewind a namespace map. // Rewind a namespace map.
if( pRewindMap ) if( pRewindMap )
{ {
m_pNamespaceMap.reset( pRewindMap ); m_pNamespaceMap = std::move( pRewindMap );
} }
} }
} }
......
...@@ -41,8 +41,8 @@ class XMLTransformerContext : public ::salhelper::SimpleReferenceObject ...@@ -41,8 +41,8 @@ class XMLTransformerContext : public ::salhelper::SimpleReferenceObject
std::unique_ptr<SvXMLNamespaceMap> m_xRewindMap; std::unique_ptr<SvXMLNamespaceMap> m_xRewindMap;
SvXMLNamespaceMap *TakeRewindMap() { return m_xRewindMap.release(); } std::unique_ptr<SvXMLNamespaceMap> TakeRewindMap() { return std::move(m_xRewindMap); }
void PutRewindMap( SvXMLNamespaceMap *p ) { m_xRewindMap.reset(p); } void PutRewindMap( std::unique_ptr<SvXMLNamespaceMap> p ) { m_xRewindMap = std::move(p); }
protected: protected:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment