summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-03 15:03:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-04 08:30:42 +0200
commit6da4e626d17a9434d5d806bac6b7bbad23218df4 (patch)
treec1f8f9aaeb650b6afbd0fab7db20e6d545915ae3
parent4fa280ced35631d5b51a2ac426912090e26ab903 (diff)
loplugin:useuniqueptr in SwContentNode
Change-Id: I32dd7e43e3ca040c1d2b8c3bdf57141dd192ffab Reviewed-on: https://gerrit.libreoffice.org/52345 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/inc/node.hxx2
-rw-r--r--sw/source/core/docnode/node.cxx8
2 files changed, 4 insertions, 6 deletions
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() )
{