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

Noel Grandin noel.grandin at collabora.co.uk
Tue Jun 26 06:08:35 UTC 2018


 cui/source/inc/optlingu.hxx     |    2 +-
 cui/source/options/optlingu.cxx |    5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 95d9d5c8d53ec6c3ced3615f9d9420e2698dc04d
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Jun 21 09:56:42 2018 +0200

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

diff --git a/cui/source/inc/optlingu.hxx b/cui/source/inc/optlingu.hxx
index 25a8d47646d2..28334ec0074f 100644
--- a/cui/source/inc/optlingu.hxx
+++ b/cui/source/inc/optlingu.hxx
@@ -67,7 +67,7 @@ class SvxEditModulesDlg : public ModalDialog
     OUString            sThes;
     OUString            sGrammar;
 
-    SvxLinguData_Impl*  pDefaultLinguData;
+    std::unique_ptr<SvxLinguData_Impl>  pDefaultLinguData;
     SvxLinguData_Impl&  rLinguData;
 
     std::unique_ptr<SvLBoxButtonData>   m_xCheckButtonData;
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index fc02af9c258a..8b62b3f5b13b 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -1710,7 +1710,7 @@ SvxEditModulesDlg::SvxEditModulesDlg(vcl::Window* pParent, SvxLinguData_Impl& rD
     get(m_pLanguageLB, "language");
     m_pLanguageLB->SetStyle(m_pLanguageLB->GetStyle() | WB_SORT);
 
-    pDefaultLinguData = new SvxLinguData_Impl( rLinguData );
+    pDefaultLinguData.reset( new SvxLinguData_Impl( rLinguData ) );
 
     m_pModulesCLB->SetStyle( m_pModulesCLB->GetStyle()|WB_CLIPCHILDREN|WB_HSCROLL );
     m_pModulesCLB->SetForceMakeVisible(true);
@@ -1762,8 +1762,7 @@ SvxEditModulesDlg::~SvxEditModulesDlg()
 
 void SvxEditModulesDlg::dispose()
 {
-    delete pDefaultLinguData;
-    pDefaultLinguData = nullptr;
+    pDefaultLinguData.reset();
     m_pLanguageLB.clear();
     for(sal_uLong i = 0; i < m_pModulesCLB->GetEntryCount(); i++)
         delete static_cast<ModuleUserData_Impl*>(m_pModulesCLB->GetEntry(i)->GetUserData());


More information about the Libreoffice-commits mailing list