summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-12 17:00:34 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-13 08:41:28 +0200
commit72a86870670ae3af7503a5c034282e5eaeaf4582 (patch)
tree8f39dc1a18b85739e93796be335789473131206d
parentc79bd83818dbd49dfd77ab82457057eff6a5d3d7 (diff)
loplugin:useuniqueptr in SwUndoInsert
Change-Id: I229cace30597543fc63222ddb5acf78539d4ba39 Reviewed-on: https://gerrit.libreoffice.org/57365 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/source/core/inc/UndoInsert.hxx2
-rw-r--r--sw/source/core/undo/unins.cxx6
2 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/core/inc/UndoInsert.hxx b/sw/source/core/inc/UndoInsert.hxx
index 5f0b652f8ed6..b109abf344e1 100644
--- a/sw/source/core/inc/UndoInsert.hxx
+++ b/sw/source/core/inc/UndoInsert.hxx
@@ -44,7 +44,7 @@ class SwUndoInsert: public SwUndo, private SwUndoSaveContent
std::unique_ptr<SwNodeIndex> m_pUndoNodeIndex;
boost::optional<OUString> maText;
boost::optional<OUString> maUndoText;
- SwRedlineData* pRedlData;
+ std::unique_ptr<SwRedlineData> pRedlData;
sal_uLong nNode;
sal_Int32 nContent, nLen;
bool bIsWordDelim : 1;
diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index 59c28db7188b..b87a0e30c3a6 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -94,8 +94,8 @@ void SwUndoInsert::Init(const SwNodeIndex & rNd)
pDoc = rNd.GetNode().GetDoc();
if( pDoc->getIDocumentRedlineAccess().IsRedlineOn() )
{
- pRedlData = new SwRedlineData( nsRedlineType_t::REDLINE_INSERT,
- pDoc->getIDocumentRedlineAccess().GetRedlineAuthor() );
+ pRedlData.reset( new SwRedlineData( nsRedlineType_t::REDLINE_INSERT,
+ pDoc->getIDocumentRedlineAccess().GetRedlineAuthor() ) );
SetRedlineFlags( pDoc->getIDocumentRedlineAccess().GetRedlineFlags() );
}
@@ -202,7 +202,7 @@ SwUndoInsert::~SwUndoInsert()
{
maText.reset();
}
- delete pRedlData;
+ pRedlData.reset();
}
void SwUndoInsert::UndoImpl(::sw::UndoRedoContext & rContext)