sw/source/core/inc/UndoTable.hxx |    2 +-
 sw/source/core/undo/untbl.cxx    |    5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 3d786062f515ab769aca172e5c08292cda9c4c8c
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Jul 18 12:16:42 2018 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Jul 19 11:56:08 2018 +0200

    loplugin:useuniqueptr in SwUndoTableNumFormat
    
    Change-Id: I6e27bdad49ec22708cf27599e9e4d54a13a160c3
    Reviewed-on: https://gerrit.libreoffice.org/57692
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx
index 15edd3a1c01e..e4f27cfbfdb4 100644
--- a/sw/source/core/inc/UndoTable.hxx
+++ b/sw/source/core/inc/UndoTable.hxx
@@ -251,7 +251,7 @@ public:
 
 class SwUndoTableNumFormat : public SwUndo
 {
-    SfxItemSet *m_pBoxSet;
+    std::unique_ptr<SfxItemSet> m_pBoxSet;
     std::unique_ptr<SwHistory> m_pHistory;
     OUString m_aStr, m_aNewFormula;
 
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 7ea6694848a4..87a5460c5f1e 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -2129,7 +2129,6 @@ void SwUndoTableMerge::SaveCollection( const SwTableBox& 
rBox )
 SwUndoTableNumFormat::SwUndoTableNumFormat( const SwTableBox& rBox,
                                     const SfxItemSet* pNewSet )
     : SwUndo(SwUndoId::TBLNUMFMT, rBox.GetFrameFormat()->GetDoc())
-    , m_pBoxSet(nullptr)
     , m_nFormatIdx(getSwDefaultTextFormat())
     , m_nNewFormatIdx(0)
     , m_fNum(0.0)
@@ -2162,7 +2161,7 @@ SwUndoTableNumFormat::SwUndoTableNumFormat( const 
SwTableBox& rBox,
             pTNd->GetpSwpHints()->DeRegister();
     }
 
-    m_pBoxSet = new SfxItemSet( pDoc->GetAttrPool(), aTableBoxSetRange );
+    m_pBoxSet.reset( new SfxItemSet( pDoc->GetAttrPool(), aTableBoxSetRange ) 
);
     m_pBoxSet->Put( rBox.GetFrameFormat()->GetAttrSet() );
 
     if( pNewSet )
@@ -2198,7 +2197,7 @@ SwUndoTableNumFormat::SwUndoTableNumFormat( const 
SwTableBox& rBox,
 SwUndoTableNumFormat::~SwUndoTableNumFormat()
 {
     m_pHistory.reset();
-    delete m_pBoxSet;
+    m_pBoxSet.reset();
 }
 
 void SwUndoTableNumFormat::UndoImpl(::sw::UndoRedoContext & rContext)
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to