sw/source/core/inc/UndoSort.hxx | 4 ++-- sw/source/core/undo/unsort.cxx | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-)
New commits: commit 623de483737bd3bb7a58d6055f99a42ecc7a8684 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Jul 13 11:23:15 2018 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Jul 16 09:40:33 2018 +0200 loplugin:useuniqueptr in SwUndoSort Change-Id: I9e524c9c653fd4b1f61e407eee12ca3a7fdc14df Reviewed-on: https://gerrit.libreoffice.org/57420 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/core/inc/UndoSort.hxx b/sw/source/core/inc/UndoSort.hxx index 8002999cbf9c..293d6a7ae0ae 100644 --- a/sw/source/core/inc/UndoSort.hxx +++ b/sw/source/core/inc/UndoSort.hxx @@ -61,9 +61,9 @@ typedef std::vector<SwNodeIndex*> SwUndoSortList; class SwUndoSort : public SwUndo, private SwUndRng { - SwSortOptions* pSortOpt; + std::unique_ptr<SwSortOptions> pSortOpt; std::vector<std::unique_ptr<SwSortUndoElement>> m_SortList; - SwUndoAttrTable* pUndoTableAttr; + std::unique_ptr<SwUndoAttrTable> pUndoTableAttr; sal_uLong nTableNd; public: diff --git a/sw/source/core/undo/unsort.cxx b/sw/source/core/undo/unsort.cxx index 89dc23b8bd46..e70ad166311f 100644 --- a/sw/source/core/undo/unsort.cxx +++ b/sw/source/core/undo/unsort.cxx @@ -48,7 +48,7 @@ SwUndoSort::SwUndoSort(const SwPaM& rRg, const SwSortOptions& rOpt) , pUndoTableAttr(nullptr) , nTableNd(0) { - pSortOpt = new SwSortOptions(rOpt); + pSortOpt.reset( new SwSortOptions(rOpt) ); } SwUndoSort::SwUndoSort( sal_uLong nStt, sal_uLong nEnd, const SwTableNode& rTableNd, @@ -59,15 +59,15 @@ SwUndoSort::SwUndoSort( sal_uLong nStt, sal_uLong nEnd, const SwTableNode& rTabl nEndNode = nEnd; nTableNd = rTableNd.GetIndex(); - pSortOpt = new SwSortOptions(rOpt); + pSortOpt.reset( new SwSortOptions(rOpt) ); if( bSaveTable ) - pUndoTableAttr = new SwUndoAttrTable( rTableNd ); + pUndoTableAttr.reset( new SwUndoAttrTable( rTableNd ) ); } SwUndoSort::~SwUndoSort() { - delete pSortOpt; - delete pUndoTableAttr; + pSortOpt.reset(); + pUndoTableAttr.reset(); } void SwUndoSort::UndoImpl(::sw::UndoRedoContext & rContext) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits