[Libreoffice-commits] core.git: sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Jul 16 11:36:08 UTC 2018
sw/source/core/inc/UndoDraw.hxx | 2 +-
sw/source/core/undo/undraw.cxx | 5 ++---
2 files changed, 3 insertions(+), 4 deletions(-)
New commits:
commit 140d9b832621df291ad58bdb85fd85465b2a6257
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Jul 13 11:57:08 2018 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Jul 16 13:35:47 2018 +0200
loplugin:useuniqueptr in SwUndoDrawDelete
Change-Id: I7d7e89a9ffa67141e459772791caae2937458b8f
Reviewed-on: https://gerrit.libreoffice.org/57425
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sw/source/core/inc/UndoDraw.hxx b/sw/source/core/inc/UndoDraw.hxx
index 7df31833a46a..892016e476db 100644
--- a/sw/source/core/inc/UndoDraw.hxx
+++ b/sw/source/core/inc/UndoDraw.hxx
@@ -116,7 +116,7 @@ public:
class SwUndoDrawDelete : public SwUndo
{
std::unique_ptr<SwUndoGroupObjImpl[]> pObjArr;
- SdrMarkList* pMarkLst; // MarkList for all selected SdrObjects
+ std::unique_ptr<SdrMarkList> pMarkLst; // MarkList for all selected SdrObjects
bool bDelFormat;
public:
diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx
index 9d164095ac5d..0572877b62b7 100644
--- a/sw/source/core/undo/undraw.cxx
+++ b/sw/source/core/undo/undraw.cxx
@@ -479,7 +479,7 @@ SwUndoDrawDelete::SwUndoDrawDelete( sal_uInt16 nCnt, const SwDoc* pDoc )
: SwUndo( SwUndoId::DRAWDELETE, pDoc ), bDelFormat( true )
{
pObjArr.reset( new SwUndoGroupObjImpl[ nCnt ] );
- pMarkLst = new SdrMarkList();
+ pMarkLst.reset( new SdrMarkList() );
}
SwUndoDrawDelete::~SwUndoDrawDelete()
@@ -490,7 +490,6 @@ SwUndoDrawDelete::~SwUndoDrawDelete()
for( size_t n = 0; n < pMarkLst->GetMarkCount(); ++n, ++pTmp )
delete pTmp->pFormat;
}
- delete pMarkLst;
}
void SwUndoDrawDelete::UndoImpl(::sw::UndoRedoContext & rContext)
@@ -516,7 +515,7 @@ void SwUndoDrawDelete::UndoImpl(::sw::UndoRedoContext & rContext)
if (pDrawFrameFormat)
pDrawFrameFormat->PosAttrSet();
}
- rContext.SetSelections(nullptr, pMarkLst);
+ rContext.SetSelections(nullptr, pMarkLst.get());
}
void SwUndoDrawDelete::RedoImpl(::sw::UndoRedoContext & rContext)
More information about the Libreoffice-commits
mailing list