Kaydet (Commit) bd9dfec2 authored tarafından Michael Stahl's avatar Michael Stahl

sw: DELETEZ to unique_ptr in SwTextFootnote

Change-Id: Ibd0a566dffca40da37727421c54b50e1d834ef3d
üst 7ca8a6c8
......@@ -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;
......
......@@ -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 )
......
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