diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-09 20:36:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-11 08:28:15 +0200 |
commit | a49440b1c4a7cd831212e2e3c19f89ce12a4e889 (patch) | |
tree | b4d76d8e03b8bb0d052f507c480a56b1db14618b /cui | |
parent | d630a53e9f48f6226f3ff7a97d400405c4df6be5 (diff) |
loplugin:useuniqueptr in SvxToolbarEntriesListBox
Change-Id: Ied01f97a09d34c43f786c030fbdd256bcf849f04
Reviewed-on: https://gerrit.libreoffice.org/55535
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/customize/SvxToolbarConfigPage.cxx | 11 | ||||
-rw-r--r-- | cui/source/inc/SvxToolbarConfigPage.hxx | 2 |
2 files changed, 6 insertions, 7 deletions
diff --git a/cui/source/customize/SvxToolbarConfigPage.cxx b/cui/source/customize/SvxToolbarConfigPage.cxx index 9cbad5b1d65d..f61203cab3f2 100644 --- a/cui/source/customize/SvxToolbarConfigPage.cxx +++ b/cui/source/customize/SvxToolbarConfigPage.cxx @@ -889,9 +889,9 @@ SvxToolbarEntriesListBox::SvxToolbarEntriesListBox(vcl::Window* pParent, SvxTool : SvxMenuEntriesListBox(pParent, pPg) , pPage(pPg) { - m_pButtonData = new SvLBoxButtonData( this ); - BuildCheckBoxButtonImages( m_pButtonData ); - EnableCheckButton( m_pButtonData ); + m_pButtonData.reset(new SvLBoxButtonData( this )); + BuildCheckBoxButtonImages( m_pButtonData.get() ); + EnableCheckButton( m_pButtonData.get() ); } SvxToolbarEntriesListBox::~SvxToolbarEntriesListBox() @@ -901,8 +901,7 @@ SvxToolbarEntriesListBox::~SvxToolbarEntriesListBox() void SvxToolbarEntriesListBox::dispose() { - delete m_pButtonData; - m_pButtonData = nullptr; + m_pButtonData.reset(); pPage.clear(); SvxMenuEntriesListBox::dispose(); @@ -971,7 +970,7 @@ void SvxToolbarEntriesListBox::DataChanged( const DataChangedEvent& rDCEvt ) if (( rDCEvt.GetType() == DataChangedEventType::SETTINGS ) && ( rDCEvt.GetFlags() & AllSettingsFlags::STYLE )) { - BuildCheckBoxButtonImages( m_pButtonData ); + BuildCheckBoxButtonImages( m_pButtonData.get() ); Invalidate(); } } diff --git a/cui/source/inc/SvxToolbarConfigPage.hxx b/cui/source/inc/SvxToolbarConfigPage.hxx index f79f3ef0fd4e..b2b71a021964 100644 --- a/cui/source/inc/SvxToolbarConfigPage.hxx +++ b/cui/source/inc/SvxToolbarConfigPage.hxx @@ -92,7 +92,7 @@ public: class SvxToolbarEntriesListBox final : public SvxMenuEntriesListBox { Size m_aCheckBoxImageSizePixel; - SvLBoxButtonData* m_pButtonData; + std::unique_ptr<SvLBoxButtonData> m_pButtonData; VclPtr<SvxConfigPage> pPage; void ChangeVisibility( SvTreeListEntry* pEntry ); |