From db3c199e947c622afe3fa6e71632e41681562009 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 20 Jun 2018 15:47:15 +0200 Subject: loplugin:useuniqueptr in SvxPatternTabPage Change-Id: I8b2493c723c65f90fd2dbef588c1fa1c669bcceb Reviewed-on: https://gerrit.libreoffice.org/56194 Tested-by: Jenkins Reviewed-by: Noel Grandin --- cui/source/inc/cuitabarea.hxx | 2 +- cui/source/tabpages/tppattern.cxx | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'cui') diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx index 2c8e55234fe9..119c466a9971 100644 --- a/cui/source/inc/cuitabarea.hxx +++ b/cui/source/inc/cuitabarea.hxx @@ -592,7 +592,7 @@ private: VclPtr m_pBtnAdd; VclPtr m_pBtnModify; - SvxBitmapCtl* m_pBitmapCtl; + std::unique_ptr m_pBitmapCtl; const SfxItemSet& m_rOutAttrs; diff --git a/cui/source/tabpages/tppattern.cxx b/cui/source/tabpages/tppattern.cxx index 9bb279850d1f..712bef2dc03e 100644 --- a/cui/source/tabpages/tppattern.cxx +++ b/cui/source/tabpages/tppattern.cxx @@ -109,7 +109,7 @@ SvxPatternTabPage::SvxPatternTabPage( vcl::Window* pParent, const SfxItemSet& r m_pCtlPreview->set_width_request(aSize.Width()); m_pCtlPreview->set_height_request(aSize.Height()); - m_pBitmapCtl = new SvxBitmapCtl; + m_pBitmapCtl.reset(new SvxBitmapCtl); // this page needs ExchangeSupport SetExchangeSupport(); @@ -137,8 +137,7 @@ SvxPatternTabPage::~SvxPatternTabPage() void SvxPatternTabPage::dispose() { - delete m_pBitmapCtl; - m_pBitmapCtl = nullptr; + m_pBitmapCtl.reset(); m_pCtlPixel.clear(); m_pLbColor.clear(); m_pLbBackgroundColor.clear(); -- cgit