summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-05-17 15:32:38 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-05-28 08:45:55 +0200
commit7fd67ca9361cc15732c505004ab4471bd2cf7f99 (patch)
treef06fe53d3e0d5a17b8cacfd22f7b1210965bb694 /basctl
parent4b5699bff586dd923123fbfd949c9bf03e491ed7 (diff)
loplugin:useuniqueptr in basctl::CheckBox
Change-Id: Iec9a0f39b3853108bdb5218e7480a09b261198ec Reviewed-on: https://gerrit.libreoffice.org/54846 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/moduldl2.cxx9
-rw-r--r--basctl/source/basicide/moduldlg.hxx2
2 files changed, 5 insertions, 6 deletions
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 020e2f4488cf..b446588a6b93 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -166,8 +166,7 @@ CheckBox::~CheckBox()
void CheckBox::dispose()
{
- delete pCheckButton;
- pCheckButton = nullptr;
+ pCheckButton.reset();
// delete user data
SvTreeListEntry* pEntry = First();
@@ -182,10 +181,10 @@ void CheckBox::dispose()
void CheckBox::Init()
{
- pCheckButton = new SvLBoxButtonData(this);
+ pCheckButton.reset(new SvLBoxButtonData(this));
if (eMode == ObjectMode::Library)
- EnableCheckButton( pCheckButton );
+ EnableCheckButton( pCheckButton.get() );
else
EnableCheckButton( nullptr );
@@ -197,7 +196,7 @@ void CheckBox::SetMode (ObjectMode e)
eMode = e;
if (eMode == ObjectMode::Library)
- EnableCheckButton( pCheckButton );
+ EnableCheckButton( pCheckButton.get() );
else
EnableCheckButton( nullptr );
}
diff --git a/basctl/source/basicide/moduldlg.hxx b/basctl/source/basicide/moduldlg.hxx
index adb1e661cd0a..cbd8b5c171f5 100644
--- a/basctl/source/basicide/moduldlg.hxx
+++ b/basctl/source/basicide/moduldlg.hxx
@@ -111,7 +111,7 @@ class CheckBox : public SvTabListBox
{
private:
ObjectMode eMode;
- SvLBoxButtonData* pCheckButton;
+ std::unique_ptr<SvLBoxButtonData> pCheckButton;
ScriptDocument m_aDocument;
void Init();