summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-03-28 10:27:25 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-03-28 13:13:53 +0100
commit0892ec50c2fe2ff1f26c7a4ea2fdef74e3d027d7 (patch)
tree0dd69f671c589910439c4f39a191c7d4800905b4
parente47a5543f4b8c9e317d1e43af8c0e5a732e461fd (diff)
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@collabora.co.uk>
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.cxx8
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.hxx18
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<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;