diff options
author | Michael Stahl <mstahl@redhat.com> | 2018-02-16 23:43:31 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2018-02-20 12:57:12 +0100 |
commit | bd9dfec21413fdd5df346e8dfecdffdd7bc30fc6 (patch) | |
tree | 3b3cb0827c6b687f8f612ea363f1dcd489a21a98 /sw | |
parent | 7ca8a6c8b17ffb4727af2df295b82d33227bdcde (diff) |
sw: DELETEZ to unique_ptr in SwTextFootnote
Change-Id: Ibd0a566dffca40da37727421c54b50e1d834ef3d
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/txtftn.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/txtnode/atrftn.cxx | 7 |
2 files changed, 5 insertions, 6 deletions
diff --git a/sw/inc/txtftn.hxx b/sw/inc/txtftn.hxx index 1a7a678b0377..3c830e7ff273 100644 --- a/sw/inc/txtftn.hxx +++ b/sw/inc/txtftn.hxx @@ -31,7 +31,7 @@ class SwFrame; class SW_DLLPUBLIC SwTextFootnote : public SwTextAttr { - SwNodeIndex * m_pStartNode; + std::unique_ptr<SwNodeIndex> m_pStartNode; SwTextNode * m_pTextNode; sal_uInt16 m_nSeqNo; @@ -39,7 +39,7 @@ public: SwTextFootnote( SwFormatFootnote& rAttr, sal_Int32 nStart ); virtual ~SwTextFootnote() override; - SwNodeIndex *GetStartNode() const { return m_pStartNode; } + SwNodeIndex *GetStartNode() const { return m_pStartNode.get(); } void SetStartNode( const SwNodeIndex *pNode, bool bDelNodes = true ); void SetNumber( const sal_uInt16 nNumber, const OUString &sNumStr ); void CopyFootnote(SwTextFootnote & rDest, SwTextNode & rDestNode) const; diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx index 799526e60802..d7b3c122f666 100644 --- a/sw/source/core/txtnode/atrftn.cxx +++ b/sw/source/core/txtnode/atrftn.cxx @@ -247,7 +247,6 @@ OUString SwFormatFootnote::GetViewNumStr( const SwDoc& rDoc, bool bInclStrings ) SwTextFootnote::SwTextFootnote( SwFormatFootnote& rAttr, sal_Int32 nStartPos ) : SwTextAttr( rAttr, nStartPos ) - , m_pStartNode( nullptr ) , m_pTextNode( nullptr ) , m_nSeqNo( USHRT_MAX ) { @@ -266,7 +265,7 @@ void SwTextFootnote::SetStartNode( const SwNodeIndex *pNewNode, bool bDelNode ) { if ( !m_pStartNode ) { - m_pStartNode = new SwNodeIndex( *pNewNode ); + m_pStartNode.reset(new SwNodeIndex(*pNewNode)); } else { @@ -308,7 +307,7 @@ void SwTextFootnote::SetStartNode( const SwNodeIndex *pNewNode, bool bDelNode ) // them (particularly not Undo) DelFrames( nullptr ); } - DELETEZ( m_pStartNode ); + m_pStartNode.reset(); // remove the footnote from the SwDoc's array for( size_t n = 0; n < pDoc->GetFootnoteIdxs().size(); ++n ) @@ -423,7 +422,7 @@ void SwTextFootnote::MakeNewTextSection( SwNodes& rNodes ) SwStartNode* pSttNd = rNodes.MakeTextSection( SwNodeIndex( rNodes.GetEndOfInserts() ), SwFootnoteStartNode, pFormatColl ); - m_pStartNode = new SwNodeIndex( *pSttNd ); + m_pStartNode.reset(new SwNodeIndex(*pSttNd)); } void SwTextFootnote::DelFrames( const SwFrame* pSib ) |