Kaydet (Commit) c2f5a026 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in TabControl

Change-Id: I4d6ce243c92de740fbb5b6934aaf14dbe28eb18e
Reviewed-on: https://gerrit.libreoffice.org/53351Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst ffe251f6
...@@ -50,7 +50,7 @@ class ListBox; ...@@ -50,7 +50,7 @@ class ListBox;
class VCL_DLLPUBLIC TabControl : public Control class VCL_DLLPUBLIC TabControl : public Control
{ {
protected: protected:
ImplTabCtrlData* mpTabCtrlData; std::unique_ptr<ImplTabCtrlData> mpTabCtrlData;
long mnLastWidth; long mnLastWidth;
long mnLastHeight; long mnLastHeight;
long mnMaxPageWidth; long mnMaxPageWidth;
......
...@@ -98,7 +98,7 @@ void TabControl::ImplInit( vcl::Window* pParent, WinBits nStyle ) ...@@ -98,7 +98,7 @@ void TabControl::ImplInit( vcl::Window* pParent, WinBits nStyle )
mbFormat = true; mbFormat = true;
mbRestoreHelpId = false; mbRestoreHelpId = false;
mbSmallInvalidate = false; mbSmallInvalidate = false;
mpTabCtrlData = new ImplTabCtrlData; mpTabCtrlData.reset(new ImplTabCtrlData);
mpTabCtrlData->mpListBox = nullptr; mpTabCtrlData->mpListBox = nullptr;
ImplInitSettings( true ); ImplInitSettings( true );
...@@ -198,8 +198,7 @@ void TabControl::dispose() ...@@ -198,8 +198,7 @@ void TabControl::dispose()
// delete TabCtrl data // delete TabCtrl data
if (mpTabCtrlData) if (mpTabCtrlData)
mpTabCtrlData->mpListBox.disposeAndClear(); mpTabCtrlData->mpListBox.disposeAndClear();
delete mpTabCtrlData; mpTabCtrlData.reset();
mpTabCtrlData = nullptr;
Control::dispose(); Control::dispose();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment