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

Noel Grandin noel.grandin at collabora.co.uk
Wed Jun 20 12:47:16 UTC 2018


 cui/source/dialogs/srchxtra.cxx |    7 +++----
 cui/source/inc/srchxtra.hxx     |    2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit d791fe853c47832aa766310947a89599b4f754e7
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Jun 11 15:21:43 2018 +0200

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

diff --git a/cui/source/dialogs/srchxtra.cxx b/cui/source/dialogs/srchxtra.cxx
index b47330756056..9e4ba7cfbfb4 100644
--- a/cui/source/dialogs/srchxtra.cxx
+++ b/cui/source/dialogs/srchxtra.cxx
@@ -65,8 +65,7 @@ SvxSearchFormatDialog::~SvxSearchFormatDialog()
 
 void SvxSearchFormatDialog::dispose()
 {
-    delete m_pFontList;
-    m_pFontList = nullptr;
+    m_pFontList.reset();
     SfxTabDialog::dispose();
 }
 
@@ -90,8 +89,8 @@ void SvxSearchFormatDialog::PageCreated( sal_uInt16 nId, SfxTabPage& rPage )
         if ( !pList )
         {
             if ( !m_pFontList )
-                m_pFontList = new FontList( this );
-            pList = m_pFontList;
+                m_pFontList.reset( new FontList( this ) );
+            pList = m_pFontList.get();
         }
 
         if ( pList )
diff --git a/cui/source/inc/srchxtra.hxx b/cui/source/inc/srchxtra.hxx
index 0e8442d39c71..23ca743016ba 100644
--- a/cui/source/inc/srchxtra.hxx
+++ b/cui/source/inc/srchxtra.hxx
@@ -38,7 +38,7 @@ protected:
     virtual void    PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) override;
 
 private:
-    FontList*  m_pFontList;
+    std::unique_ptr<FontList> m_pFontList;
     sal_uInt16 m_nNamePageId;
     sal_uInt16 m_nParaStdPageId;
     sal_uInt16 m_nParaAlignPageId;


More information about the Libreoffice-commits mailing list