sw/inc/node.hxx | 2 +- sw/source/core/docnode/node.cxx | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-)
New commits: commit 6da4e626d17a9434d5d806bac6b7bbad23218df4 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Tue Apr 3 15:03:21 2018 +0200 loplugin:useuniqueptr in SwContentNode Change-Id: I32dd7e43e3ca040c1d2b8c3bdf57141dd192ffab Reviewed-on: https://gerrit.libreoffice.org/52345 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx index e16b797f641d..27078a918be4 100644 --- a/sw/inc/node.hxx +++ b/sw/inc/node.hxx @@ -350,7 +350,7 @@ class SW_DLLPUBLIC SwContentNode: public SwModify, public SwNode, public SwIndex { //FEATURE::CONDCOLL - SwDepend* m_pCondColl; + std::unique_ptr<SwDepend> m_pCondColl; //FEATURE::CONDCOLL mutable bool mbSetModifyAtAttr; diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 3db76343d687..112d06e28173 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -1012,7 +1012,7 @@ SwContentNode::~SwContentNode() // Thus, we need to delete all Frames in the dependency list. DelFrames(false); - delete m_pCondColl; + m_pCondColl.reset(); if ( mpAttrSet.get() && mbSetModifyAtAttr ) const_cast<SwAttrSet*>(static_cast<const SwAttrSet*>(mpAttrSet.get()))->SetModifyAtAttr( nullptr ); @@ -1762,11 +1762,9 @@ void SwContentNode::SetCondFormatColl( SwFormatColl* pColl ) ( pColl && pColl != m_pCondColl->GetRegisteredIn() ) ) { SwFormatColl* pOldColl = GetCondFormatColl(); - delete m_pCondColl; + m_pCondColl.reset(); if( pColl ) - m_pCondColl = new SwDepend( this, pColl ); - else - m_pCondColl = nullptr; + m_pCondColl.reset(new SwDepend( this, pColl )); if( GetpSwAttrSet() ) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits