From 0892ec50c2fe2ff1f26c7a4ea2fdef74e3d027d7 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 28 Mar 2019 10:27:25 +0200 Subject: loplugin:useuniqueptr in sc dialog constructors Change-Id: I9fef0d3d567d9a0143c7a796725a44348b96bb23 Reviewed-on: https://gerrit.libreoffice.org/69880 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sc/source/ui/attrdlg/scdlgfact.cxx | 8 ++++---- sc/source/ui/attrdlg/scdlgfact.hxx | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index 581391c4857a..740c06ffc2a2 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -931,25 +931,25 @@ VclPtr ScAbstractDialogFactory_Impl::CreateScDPSubtotal VclPtr ScAbstractDialogFactory_Impl::CreateScDPNumGroupDlg(weld::Window* pParent, const ScDPNumGroupInfo& rInfo) { - return VclPtr::Create(new ScDPNumGroupDlg(pParent, rInfo)); + return VclPtr::Create(std::make_unique(pParent, rInfo)); } VclPtr ScAbstractDialogFactory_Impl::CreateScDPDateGroupDlg( weld::Window* pParent, const ScDPNumGroupInfo& rInfo, sal_Int32 nDatePart, const Date& rNullDate) { - return VclPtr::Create(new ScDPDateGroupDlg(pParent, rInfo, nDatePart, rNullDate)); + return VclPtr::Create(std::make_unique(pParent, rInfo, nDatePart, rNullDate)); } VclPtr ScAbstractDialogFactory_Impl::CreateScDPShowDetailDlg ( weld::Window* pParent, ScDPObject& rDPObj, css::sheet::DataPilotFieldOrientation nOrient ) { - return VclPtr::Create(new ScDPShowDetailDlg(pParent, rDPObj, nOrient)); + return VclPtr::Create(std::make_unique(pParent, rDPObj, nOrient)); } VclPtr ScAbstractDialogFactory_Impl::CreateScNewScenarioDlg(weld::Window* pParent, const OUString& rName, bool bEdit, bool bSheetProtected) { - return VclPtr::Create(new ScNewScenarioDlg(pParent, rName, bEdit, bSheetProtected)); + return VclPtr::Create(std::make_unique(pParent, rName, bEdit, bSheetProtected)); } VclPtr ScAbstractDialogFactory_Impl::CreateScShowTabDlg(weld::Window* pParent) diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index 4d762f219742..aa8c949c337f 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -428,8 +428,8 @@ class AbstractScDPNumGroupDlg_Impl : public AbstractScDPNumGroupDlg { std::unique_ptr m_xDlg; public: - explicit AbstractScDPNumGroupDlg_Impl(ScDPNumGroupDlg* p) - : m_xDlg(p) + explicit AbstractScDPNumGroupDlg_Impl(std::unique_ptr p) + : m_xDlg(std::move(p)) { } virtual short Execute() override; @@ -440,8 +440,8 @@ class AbstractScDPDateGroupDlg_Impl : public AbstractScDPDateGroupDlg { std::unique_ptr m_xDlg; public: - explicit AbstractScDPDateGroupDlg_Impl(ScDPDateGroupDlg* p) - : m_xDlg(p) + explicit AbstractScDPDateGroupDlg_Impl(std::unique_ptr p) + : m_xDlg(std::move(p)) { } virtual short Execute() override; @@ -451,10 +451,10 @@ public: class AbstractScDPShowDetailDlg_Impl : public AbstractScDPShowDetailDlg { - std::shared_ptr m_xDlg; + std::unique_ptr m_xDlg; public: - explicit AbstractScDPShowDetailDlg_Impl(ScDPShowDetailDlg* p) - : m_xDlg(p) + explicit AbstractScDPShowDetailDlg_Impl(std::unique_ptr p) + : m_xDlg(std::move(p)) { } virtual short Execute() override; @@ -465,8 +465,8 @@ class AbstractScNewScenarioDlg_Impl : public AbstractScNewScenarioDlg { std::unique_ptr m_xDlg; public: - explicit AbstractScNewScenarioDlg_Impl(ScNewScenarioDlg* p) - : m_xDlg(p) + explicit AbstractScNewScenarioDlg_Impl(std::unique_ptr p) + : m_xDlg(std::move(p)) { } virtual short Execute() override; -- cgit