[Libreoffice-commits] core.git: chart2/source

Noel Grandin noel.grandin at collabora.co.uk
Mon Jun 11 06:27:55 UTC 2018


 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(-)

New commits:
commit 949aecad9a6341d4994a716c22191c682e91bce7
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Jun 4 16:34:37 2018 +0200

    loplugin:useuniqueptr in ThreeD_SceneIllumination_TabPage
    
    Change-Id: I297f79d38b6e04a6df322f875f9410078a01c1f3
    Reviewed-on: https://gerrit.libreoffice.org/55531
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

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<SvxLightCtl3D>   m_pCtl_Preview;
 
-    LightSourceInfo* m_pLightSourceInfoList;
+    std::unique_ptr<LightSourceInfo[]> m_pLightSourceInfoList;
 
     css::uno::Reference< css::beans::XPropertySet > m_xSceneProperties;
 


More information about the Libreoffice-commits mailing list