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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Jul 30 06:21:51 UTC 2018


 sw/source/ui/index/cnttab.cxx       |    8 ++++----
 sw/source/uibase/inc/swuicnttab.hxx |    4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 466d6d77f08a46f7801ba3b9771c25c2eb2a7902
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Jul 27 08:57:34 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Jul 30 08:21:27 2018 +0200

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

diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 48517308463e..5680a394e160 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -816,7 +816,7 @@ SwTOXSelectTabPage::SwTOXSelectTabPage(vcl::Window* pParent, const SfxItemSet& r
     get(m_pLanguageLB, "lang");
     get(m_pSortAlgorithmLB, "keytype");
 
-    pIndexEntryWrapper = new IndexEntrySupplierWrapper();
+    pIndexEntryWrapper.reset(new IndexEntrySupplierWrapper());
 
     m_pLanguageLB->SetLanguageList( SvxLanguageListFlags::ALL | SvxLanguageListFlags::ONLY_KNOWN,
                                  false );
@@ -877,8 +877,8 @@ SwTOXSelectTabPage::~SwTOXSelectTabPage()
 
 void SwTOXSelectTabPage::dispose()
 {
-    delete pIndexRes;
-    delete pIndexEntryWrapper;
+    pIndexRes.reset();
+    pIndexEntryWrapper.reset();
     m_pTitleED.clear();
     m_pTypeFT.clear();
     m_pTypeLB.clear();
@@ -1416,7 +1416,7 @@ void SwTOXSelectTabPage::LanguageHdl( ListBox const * pBox )
     Sequence< OUString > aSeq = pIndexEntryWrapper->GetAlgorithmList( aLcl );
 
     if( !pIndexRes )
-        pIndexRes = new IndexEntryResource();
+        pIndexRes.reset(new IndexEntryResource());
 
     OUString sOldString;
     void* pUserData;
diff --git a/sw/source/uibase/inc/swuicnttab.hxx b/sw/source/uibase/inc/swuicnttab.hxx
index 0941e1bab00c..522a0a1298c4 100644
--- a/sw/source/uibase/inc/swuicnttab.hxx
+++ b/sw/source/uibase/inc/swuicnttab.hxx
@@ -190,7 +190,7 @@ class SwTOXSelectTabPage : public SfxTabPage
     VclPtr<SvxLanguageBox> m_pLanguageLB;
     VclPtr<ListBox>        m_pSortAlgorithmLB;
 
-    IndexEntryResource* pIndexRes;
+    std::unique_ptr<IndexEntryResource> pIndexRes;
 
     OUString        aStyleArr[MAXLEVEL];
     OUString        sAutoMarkURL;
@@ -198,7 +198,7 @@ class SwTOXSelectTabPage : public SfxTabPage
     OUString        sAddStyleUser;
     OUString        sAddStyleContent;
 
-    const IndexEntrySupplierWrapper* pIndexEntryWrapper;
+    std::unique_ptr<const IndexEntrySupplierWrapper> pIndexEntryWrapper;
 
     bool            m_bWaitingInitialSettings;
 


More information about the Libreoffice-commits mailing list