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

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Thu Mar 28 12:14:20 UTC 2019


 sc/source/ui/attrdlg/scdlgfact.cxx |    8 ++++----
 sc/source/ui/attrdlg/scdlgfact.hxx |   18 +++++++++---------
 2 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 0892ec50c2fe2ff1f26c7a4ea2fdef74e3d027d7
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Mar 28 10:27:25 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Mar 28 13:13:53 2019 +0100

    loplugin:useuniqueptr in sc dialog constructors
    
    Change-Id: I9fef0d3d567d9a0143c7a796725a44348b96bb23
    Reviewed-on: https://gerrit.libreoffice.org/69880
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

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<AbstractScDPSubtotalDlg> ScAbstractDialogFactory_Impl::CreateScDPSubtotal
 
 VclPtr<AbstractScDPNumGroupDlg> ScAbstractDialogFactory_Impl::CreateScDPNumGroupDlg(weld::Window* pParent, const ScDPNumGroupInfo& rInfo)
 {
-    return VclPtr<AbstractScDPNumGroupDlg_Impl>::Create(new ScDPNumGroupDlg(pParent, rInfo));
+    return VclPtr<AbstractScDPNumGroupDlg_Impl>::Create(std::make_unique<ScDPNumGroupDlg>(pParent, rInfo));
 }
 
 VclPtr<AbstractScDPDateGroupDlg> ScAbstractDialogFactory_Impl::CreateScDPDateGroupDlg(
         weld::Window* pParent, const ScDPNumGroupInfo& rInfo, sal_Int32 nDatePart, const Date& rNullDate)
 {
-    return VclPtr<AbstractScDPDateGroupDlg_Impl>::Create(new ScDPDateGroupDlg(pParent, rInfo, nDatePart, rNullDate));
+    return VclPtr<AbstractScDPDateGroupDlg_Impl>::Create(std::make_unique<ScDPDateGroupDlg>(pParent, rInfo, nDatePart, rNullDate));
 }
 
 VclPtr<AbstractScDPShowDetailDlg> ScAbstractDialogFactory_Impl::CreateScDPShowDetailDlg (
         weld::Window* pParent, ScDPObject& rDPObj, css::sheet::DataPilotFieldOrientation nOrient )
 {
-    return VclPtr<AbstractScDPShowDetailDlg_Impl>::Create(new ScDPShowDetailDlg(pParent, rDPObj, nOrient));
+    return VclPtr<AbstractScDPShowDetailDlg_Impl>::Create(std::make_unique<ScDPShowDetailDlg>(pParent, rDPObj, nOrient));
 }
 
 VclPtr<AbstractScNewScenarioDlg> ScAbstractDialogFactory_Impl::CreateScNewScenarioDlg(weld::Window* pParent, const OUString& rName,
     bool bEdit, bool bSheetProtected)
 {
-    return VclPtr<AbstractScNewScenarioDlg_Impl>::Create(new ScNewScenarioDlg(pParent, rName, bEdit, bSheetProtected));
+    return VclPtr<AbstractScNewScenarioDlg_Impl>::Create(std::make_unique<ScNewScenarioDlg>(pParent, rName, bEdit, bSheetProtected));
 }
 
 VclPtr<AbstractScShowTabDlg> 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<ScDPNumGroupDlg> m_xDlg;
 public:
-    explicit AbstractScDPNumGroupDlg_Impl(ScDPNumGroupDlg* p)
-        : m_xDlg(p)
+    explicit AbstractScDPNumGroupDlg_Impl(std::unique_ptr<ScDPNumGroupDlg> p)
+        : m_xDlg(std::move(p))
     {
     }
     virtual short Execute() override;
@@ -440,8 +440,8 @@ class AbstractScDPDateGroupDlg_Impl : public AbstractScDPDateGroupDlg
 {
     std::unique_ptr<ScDPDateGroupDlg> m_xDlg;
 public:
-    explicit AbstractScDPDateGroupDlg_Impl(ScDPDateGroupDlg* p)
-        : m_xDlg(p)
+    explicit AbstractScDPDateGroupDlg_Impl(std::unique_ptr<ScDPDateGroupDlg> p)
+        : m_xDlg(std::move(p))
     {
     }
     virtual short Execute() override;
@@ -451,10 +451,10 @@ public:
 
 class AbstractScDPShowDetailDlg_Impl : public AbstractScDPShowDetailDlg
 {
-    std::shared_ptr<ScDPShowDetailDlg> m_xDlg;
+    std::unique_ptr<ScDPShowDetailDlg> m_xDlg;
 public:
-    explicit AbstractScDPShowDetailDlg_Impl(ScDPShowDetailDlg* p)
-        : m_xDlg(p)
+    explicit AbstractScDPShowDetailDlg_Impl(std::unique_ptr<ScDPShowDetailDlg> p)
+        : m_xDlg(std::move(p))
     {
     }
     virtual short Execute() override;
@@ -465,8 +465,8 @@ class AbstractScNewScenarioDlg_Impl : public AbstractScNewScenarioDlg
 {
     std::unique_ptr<ScNewScenarioDlg> m_xDlg;
 public:
-    explicit AbstractScNewScenarioDlg_Impl(ScNewScenarioDlg* p)
-        : m_xDlg(p)
+    explicit AbstractScNewScenarioDlg_Impl(std::unique_ptr<ScNewScenarioDlg> p)
+        : m_xDlg(std::move(p))
     {
     }
     virtual short           Execute() override;


More information about the Libreoffice-commits mailing list