Kaydet (Commit) 1c944356 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in SvxCheckListBox

Change-Id: Ib867d42363a500ea5acfc0998dd33657d3a701c3
Reviewed-on: https://gerrit.libreoffice.org/53708Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst c4b8edef
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <tools/wintypes.hxx> #include <tools/wintypes.hxx>
#include <vcl/event.hxx> #include <vcl/event.hxx>
#include <vcl/window.hxx> #include <vcl/window.hxx>
#include <memory>
class Image; class Image;
class SvLBoxButtonData; class SvLBoxButtonData;
...@@ -40,7 +41,7 @@ class SVX_DLLPUBLIC SvxCheckListBox : public SvTreeListBox ...@@ -40,7 +41,7 @@ class SVX_DLLPUBLIC SvxCheckListBox : public SvTreeListBox
using Window::GetText; using Window::GetText;
private: private:
SvLBoxButtonData* pCheckButton; std::unique_ptr<SvLBoxButtonData> pCheckButton;
SVX_DLLPRIVATE void Init_Impl(); SVX_DLLPRIVATE void Init_Impl();
......
...@@ -44,14 +44,14 @@ SvxCheckListBox::~SvxCheckListBox() ...@@ -44,14 +44,14 @@ SvxCheckListBox::~SvxCheckListBox()
void SvxCheckListBox::dispose() void SvxCheckListBox::dispose()
{ {
delete pCheckButton; pCheckButton.reset();
SvTreeListBox::dispose(); SvTreeListBox::dispose();
} }
void SvxCheckListBox::Init_Impl() void SvxCheckListBox::Init_Impl()
{ {
pCheckButton = new SvLBoxButtonData( this ); pCheckButton.reset(new SvLBoxButtonData( this ));
EnableCheckButton( pCheckButton ); EnableCheckButton( pCheckButton.get() );
} }
void SvxCheckListBox::InsertEntry( const OUString& rStr, sal_uLong nPos, void SvxCheckListBox::InsertEntry( const OUString& rStr, sal_uLong nPos,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment