From 949aecad9a6341d4994a716c22191c682e91bce7 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 4 Jun 2018 16:34:37 +0200 Subject: loplugin:useuniqueptr in ThreeD_SceneIllumination_TabPage Change-Id: I297f79d38b6e04a6df322f875f9410078a01c1f3 Reviewed-on: https://gerrit.libreoffice.org/55531 Tested-by: Jenkins Reviewed-by: Noel Grandin --- chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx | 5 ++--- chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'chart2') diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx index ac1f95d7265d..c99e654dd2fd 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx @@ -230,7 +230,7 @@ ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage( vcl::Window* get(m_pCtl_Preview, "CTL_LIGHT_PREVIEW"); - m_pLightSourceInfoList = new LightSourceInfo[8]; + m_pLightSourceInfoList.reset(new LightSourceInfo[8]); m_pLightSourceInfoList[0].pButton = m_pBtn_Light1; m_pLightSourceInfoList[1].pButton = m_pBtn_Light2; m_pLightSourceInfoList[2].pButton = m_pBtn_Light3; @@ -270,8 +270,7 @@ ThreeD_SceneIllumination_TabPage::~ThreeD_SceneIllumination_TabPage() void ThreeD_SceneIllumination_TabPage::dispose() { - delete[] m_pLightSourceInfoList; - m_pLightSourceInfoList = nullptr; + m_pLightSourceInfoList.reset(); m_pBtn_Light1.clear(); m_pBtn_Light2.clear(); m_pBtn_Light3.clear(); diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx index f35cb1b503a4..04023f053f7c 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx @@ -90,7 +90,7 @@ private: VclPtr m_pCtl_Preview; - LightSourceInfo* m_pLightSourceInfoList; + std::unique_ptr m_pLightSourceInfoList; css::uno::Reference< css::beans::XPropertySet > m_xSceneProperties; -- cgit