summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-23 13:27:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-24 08:22:13 +0200
commitc2f5a026ca643b104bf88cfb0429de1ea81d38dc (patch)
tree518e9f98d25c6a849d3d4b6f2aacffc1f38d8a92
parentffe251f62aec250118598041d3528cee54c65538 (diff)
loplugin:useuniqueptr in TabControl
Change-Id: I4d6ce243c92de740fbb5b6934aaf14dbe28eb18e Reviewed-on: https://gerrit.libreoffice.org/53351 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--include/vcl/tabctrl.hxx2
-rw-r--r--vcl/source/control/tabctrl.cxx5
2 files changed, 3 insertions, 4 deletions
diff --git a/include/vcl/tabctrl.hxx b/include/vcl/tabctrl.hxx
index 6286ecea7ef7..6fd7cd3841f5 100644
--- a/include/vcl/tabctrl.hxx
+++ b/include/vcl/tabctrl.hxx
@@ -50,7 +50,7 @@ class ListBox;
class VCL_DLLPUBLIC TabControl : public Control
{
protected:
- ImplTabCtrlData* mpTabCtrlData;
+ std::unique_ptr<ImplTabCtrlData> mpTabCtrlData;
long mnLastWidth;
long mnLastHeight;
long mnMaxPageWidth;
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 13f08e464724..36393f20906c 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -98,7 +98,7 @@ void TabControl::ImplInit( vcl::Window* pParent, WinBits nStyle )
mbFormat = true;
mbRestoreHelpId = false;
mbSmallInvalidate = false;
- mpTabCtrlData = new ImplTabCtrlData;
+ mpTabCtrlData.reset(new ImplTabCtrlData);
mpTabCtrlData->mpListBox = nullptr;
ImplInitSettings( true );
@@ -198,8 +198,7 @@ void TabControl::dispose()
// delete TabCtrl data
if (mpTabCtrlData)
mpTabCtrlData->mpListBox.disposeAndClear();
- delete mpTabCtrlData;
- mpTabCtrlData = nullptr;
+ mpTabCtrlData.reset();
Control::dispose();
}