[Libreoffice-commits] core.git: 2 commits - sfx2/source

Noel Grandin noel.grandin at collabora.co.uk
Wed Jan 24 06:57:41 UTC 2018


 sfx2/source/dialog/filedlghelper.cxx |    4 ++--
 sfx2/source/dialog/filedlgimpl.hxx   |    2 +-
 sfx2/source/dialog/templdlg.cxx      |    6 +++---
 sfx2/source/inc/templdgi.hxx         |    2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 3199d25a2e0f533fdd52e0a8006552df1a5932ca
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Jan 16 16:13:43 2018 +0200

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

diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index fc1e0753c308..204a7346d6d5 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -861,7 +861,7 @@ SfxCommonTemplateDialog_Impl::~SfxCommonTemplateDialog_Impl()
         EndListening(*pStyleSheetPool);
     pStyleSheetPool = nullptr;
     pTreeBox.disposeAndClear();
-    delete pIdle;
+    pIdle.reset();
     if ( m_pDeletionWatcher )
         m_pDeletionWatcher->signal();
     aFmtLb.disposeAndClear();
@@ -1402,7 +1402,7 @@ IMPL_LINK_NOARG( SfxCommonTemplateDialog_Impl, TimeOut, Timer *, void )
             }
         }
         bDontUpdate=false;
-        DELETEZ(pIdle);
+        pIdle.reset();
     }
     else
         pIdle->Start();
@@ -1488,7 +1488,7 @@ void SfxCommonTemplateDialog_Impl::Notify(SfxBroadcaster& /*rBC*/, const SfxHint
     {
         if(!pIdle)
         {
-            pIdle=new Idle("SfxCommonTemplate");
+            pIdle.reset(new Idle("SfxCommonTemplate"));
             pIdle->SetPriority(TaskPriority::LOWEST);
             pIdle->SetInvokeHandler(LINK(this,SfxCommonTemplateDialog_Impl,TimeOut));
         }
diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx
index 4a911d292003..381da18b8916 100644
--- a/sfx2/source/inc/templdgi.hxx
+++ b/sfx2/source/inc/templdgi.hxx
@@ -176,7 +176,7 @@ protected:
     VclPtr<PopupMenu> mxMenu;
     OString sLastItemIdent;
     SfxModule* pModule;
-    Idle* pIdle;
+    std::unique_ptr<Idle> pIdle;
 
     SfxStyleFamilies* pStyleFamilies;
     SfxTemplateItem* pFamilyState[MAX_FAMILIES];
commit 9f3dccf5558915617d02c8cc0d795ec45e2532d1
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Jan 16 16:05:30 2018 +0200

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

diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index 738ab2564497..1ae72bddd3dc 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -1141,7 +1141,7 @@ FileDialogHelper_Impl::~FileDialogHelper_Impl()
         Application::RemoveUserEvent( mnPostUserEventId );
     mnPostUserEventId = nullptr;
 
-    delete mpGraphicFilter;
+    mpGraphicFilter.reset();
 
     if ( mbDeleteMatcher )
         delete mpMatcher;
@@ -1841,7 +1841,7 @@ void FileDialogHelper_Impl::addGraphicFilter()
         return;
 
     // create the list of filters
-    mpGraphicFilter = new GraphicFilter;
+    mpGraphicFilter.reset( new GraphicFilter );
     sal_uInt16 i, j, nCount = mpGraphicFilter->GetImportFormatCount();
 
     // compute the extension string for all known import filters
diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx
index b7aae374dfcd..38a894e0d42e 100644
--- a/sfx2/source/dialog/filedlgimpl.hxx
+++ b/sfx2/source/dialog/filedlgimpl.hxx
@@ -50,7 +50,7 @@ namespace sfx2
         std::vector< css::beans::StringPair >   maFilters;
 
         SfxFilterMatcher*           mpMatcher;
-        GraphicFilter*              mpGraphicFilter;
+        std::unique_ptr<GraphicFilter> mpGraphicFilter;
         FileDialogHelper*           mpAntiImpl;
         VclPtr<vcl::Window>         mpPreferredParentWindow;
 


More information about the Libreoffice-commits mailing list