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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Jul 19 09:56:34 UTC 2018


 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.grandin at collabora.co.uk>
AuthorDate: Wed Jul 18 12:16:42 2018 +0200
Commit:     Noel Grandin <noel.grandin at 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.grandin at 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)


More information about the Libreoffice-commits mailing list