[Libreoffice-commits] core.git: editeng/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Sep 7 06:49:09 UTC 2018


 editeng/source/editeng/impedit.hxx  |    2 +-
 editeng/source/editeng/impedit5.cxx |    8 +++-----
 2 files changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 9e17d32da3cec059f9f994d502ff67dbcbf3bb50
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Sep 6 14:54:07 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Sep 7 08:48:37 2018 +0200

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

diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 08951792e149..ab454ad703f1 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -451,7 +451,7 @@ private:
 
     std::unique_ptr<SfxItemSet> pEmptyItemSet;
     EditUndoManager*    pUndoManager;
-    ESelection*         pUndoMarkSelection;
+    std::unique_ptr<ESelection> pUndoMarkSelection;
 
     std::unique_ptr<ImplIMEInfos> mpIMEInfos;
 
diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx
index 2b5f4b391b83..109450adbd9e 100644
--- a/editeng/source/editeng/impedit5.cxx
+++ b/editeng/source/editeng/impedit5.cxx
@@ -242,7 +242,7 @@ void ImpEditEngine::UndoActionStart( sal_uInt16 nId, const ESelection& aSel )
     {
         GetUndoManager().EnterListAction( GetEditEnginePtr()->GetUndoComment( nId ), OUString(), nId, CreateViewShellId() );
         DBG_ASSERT( !pUndoMarkSelection, "UndoAction SelectionMarker?" );
-        pUndoMarkSelection = new ESelection( aSel );
+        pUndoMarkSelection.reset(new ESelection( aSel ));
     }
 }
 
@@ -260,8 +260,7 @@ void ImpEditEngine::UndoActionEnd()
     if ( IsUndoEnabled() && !IsInUndo() )
     {
         GetUndoManager().LeaveListAction();
-        delete pUndoMarkSelection;
-        pUndoMarkSelection = nullptr;
+        pUndoMarkSelection.reset();
     }
 }
 
@@ -272,8 +271,7 @@ void ImpEditEngine::InsertUndo( EditUndo* pUndo, bool bTryMerge )
     {
         EditUndoMarkSelection* pU = new EditUndoMarkSelection(pEditEngine, *pUndoMarkSelection);
         GetUndoManager().AddUndoAction( pU );
-        delete pUndoMarkSelection;
-        pUndoMarkSelection = nullptr;
+        pUndoMarkSelection.reset();
     }
     GetUndoManager().AddUndoAction( pUndo, bTryMerge );
 


More information about the Libreoffice-commits mailing list