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>
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
|
@@ -111,7 +111,7 @@ class CheckBox : public SvTabListBox
|
||||
{
|
||||
private:
|
||||
ObjectMode eMode;
|
||||
SvLBoxButtonData* pCheckButton;
|
||||
std::unique_ptr<SvLBoxButtonData> pCheckButton;
|
||||
ScriptDocument m_aDocument;
|
||||
void Init();
|
||||
|
||||
|
Reference in New Issue
Block a user