[Libreoffice-commits] core.git: 2 commits - sw/source

Noel Grandin noel.grandin at collabora.co.uk
Fri Jul 13 06:41:57 UTC 2018


 sw/source/core/inc/UndoInsert.hxx    |    2 +-
 sw/source/core/inc/UndoSplitMove.hxx |    2 +-
 sw/source/core/undo/unins.cxx        |    6 +++---
 sw/source/core/undo/unspnd.cxx       |    4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 0673411c58529e6c4252b7973a16afae1f4363f1
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Jul 12 17:01:48 2018 +0200

    loplugin:useuniqueptr in SwUndoSplitNode
    
    Change-Id: Ib77b31a7558b5d3c928d774d3c6bdaeff26c177d
    Reviewed-on: https://gerrit.libreoffice.org/57366
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/source/core/inc/UndoSplitMove.hxx b/sw/source/core/inc/UndoSplitMove.hxx
index d4a86dea4cbc..08e59657c4d4 100644
--- a/sw/source/core/inc/UndoSplitMove.hxx
+++ b/sw/source/core/inc/UndoSplitMove.hxx
@@ -25,7 +25,7 @@
 class SwUndoSplitNode: public SwUndo
 {
     std::unique_ptr<SwHistory> m_pHistory;
-    SwRedlineData* pRedlData;
+    std::unique_ptr<SwRedlineData> pRedlData;
     sal_uLong nNode;
     sal_Int32 nContent;
     bool bTableFlag : 1;
diff --git a/sw/source/core/undo/unspnd.cxx b/sw/source/core/undo/unspnd.cxx
index 2253c3df5124..27d73ebd8ee7 100644
--- a/sw/source/core/undo/unspnd.cxx
+++ b/sw/source/core/undo/unspnd.cxx
@@ -56,7 +56,7 @@ SwUndoSplitNode::SwUndoSplitNode( SwDoc* pDoc, const SwPosition& rPos,
     // consider Redline
     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() );
     }
 
@@ -66,7 +66,7 @@ SwUndoSplitNode::SwUndoSplitNode( SwDoc* pDoc, const SwPosition& rPos,
 SwUndoSplitNode::~SwUndoSplitNode()
 {
     m_pHistory.reset();
-    delete pRedlData;
+    pRedlData.reset();
 }
 
 void SwUndoSplitNode::UndoImpl(::sw::UndoRedoContext & rContext)
commit 72a86870670ae3af7503a5c034282e5eaeaf4582
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Jul 12 17:00:34 2018 +0200

    loplugin:useuniqueptr in SwUndoInsert
    
    Change-Id: I229cace30597543fc63222ddb5acf78539d4ba39
    Reviewed-on: https://gerrit.libreoffice.org/57365
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

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)


More information about the Libreoffice-commits mailing list