[Libreoffice-commits] core.git: include/svx svx/source

Noel Grandin noel.grandin at collabora.co.uk
Wed May 2 06:26:57 UTC 2018


 include/svx/checklbx.hxx       |    3 ++-
 svx/source/dialog/checklbx.cxx |    6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 1c944356f817013353819c6eb4bc5ed86356658d
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Apr 30 19:13:30 2018 +0200

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

diff --git a/include/svx/checklbx.hxx b/include/svx/checklbx.hxx
index 76540dfd225b..98e955b353df 100644
--- a/include/svx/checklbx.hxx
+++ b/include/svx/checklbx.hxx
@@ -28,6 +28,7 @@
 #include <tools/wintypes.hxx>
 #include <vcl/event.hxx>
 #include <vcl/window.hxx>
+#include <memory>
 
 class Image;
 class SvLBoxButtonData;
@@ -40,7 +41,7 @@ class SVX_DLLPUBLIC SvxCheckListBox : public SvTreeListBox
     using Window::GetText;
 
 private:
-    SvLBoxButtonData*   pCheckButton;
+    std::unique_ptr<SvLBoxButtonData> pCheckButton;
 
     SVX_DLLPRIVATE void             Init_Impl();
 
diff --git a/svx/source/dialog/checklbx.cxx b/svx/source/dialog/checklbx.cxx
index 5bf4c8610087..41c5a42ed93c 100644
--- a/svx/source/dialog/checklbx.cxx
+++ b/svx/source/dialog/checklbx.cxx
@@ -44,14 +44,14 @@ SvxCheckListBox::~SvxCheckListBox()
 
 void SvxCheckListBox::dispose()
 {
-    delete pCheckButton;
+    pCheckButton.reset();
     SvTreeListBox::dispose();
 }
 
 void SvxCheckListBox::Init_Impl()
 {
-    pCheckButton = new SvLBoxButtonData( this );
-    EnableCheckButton( pCheckButton );
+    pCheckButton.reset(new SvLBoxButtonData( this ));
+    EnableCheckButton( pCheckButton.get() );
 }
 
 void SvxCheckListBox::InsertEntry( const OUString& rStr, sal_uLong nPos,


More information about the Libreoffice-commits mailing list