diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-30 11:29:34 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-30 12:21:50 +0200 |
commit | 5efd34eabcbd374f0f06cac12b7b25f955db7965 (patch) | |
tree | 7620ad55c72af34e08c740d134638b6b60357de1 /sc/source/ui/attrdlg | |
parent | 97e85db82e56c3d1cba6fb10842ffb85cd804a8d (diff) |
loplugin:makeshared in sc
Change-Id: I512d05ea24c519c25f03a35842e362bf23f05693
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93198
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/attrdlg')
-rw-r--r-- | sc/source/ui/attrdlg/scdlgfact.cxx | 40 | ||||
-rw-r--r-- | sc/source/ui/attrdlg/scdlgfact.hxx | 10 |
2 files changed, 25 insertions, 25 deletions
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index 613f5711a470..e947993cacd2 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -940,7 +940,7 @@ VclPtr<AbstractScImportAsciiDlg> ScAbstractDialogFactory_Impl::CreateScImportAsc const OUString& aDatName, SvStream* pInStream, ScImportAsciiCall eCall) { - return VclPtr<AbstractScImportAsciiDlg_Impl>::Create(std::make_unique<ScImportAsciiDlg>(pParent, aDatName,pInStream, eCall)); + return VclPtr<AbstractScImportAsciiDlg_Impl>::Create(std::make_shared<ScImportAsciiDlg>(pParent, aDatName,pInStream, eCall)); } VclPtr<AbstractScTextImportOptionsDlg> ScAbstractDialogFactory_Impl::CreateScTextImportOptionsDlg(weld::Window* pParent) @@ -969,7 +969,7 @@ VclPtr<AbstractScSortWarningDlg> ScAbstractDialogFactory_Impl::CreateScSortWarni VclPtr<AbstractScCondFormatManagerDlg> ScAbstractDialogFactory_Impl::CreateScCondFormatMgrDlg(weld::Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList ) { - return VclPtr<AbstractScCondFormatManagerDlg_Impl>::Create(std::make_unique<ScCondFormatManagerDlg>(pParent, pDoc, pFormatList)); + return VclPtr<AbstractScCondFormatManagerDlg_Impl>::Create(std::make_shared<ScCondFormatManagerDlg>(pParent, pDoc, pFormatList)); } VclPtr<AbstractScDataPilotDatabaseDlg> ScAbstractDialogFactory_Impl::CreateScDataPilotDatabaseDlg(weld::Window* pParent) @@ -1132,7 +1132,7 @@ VclPtr<AbstractScNewScenarioDlg> ScAbstractDialogFactory_Impl::CreateScNewScenar VclPtr<AbstractScShowTabDlg> ScAbstractDialogFactory_Impl::CreateScShowTabDlg(weld::Window* pParent) { - return VclPtr<AbstractScShowTabDlg_Impl>::Create(new ScShowTabDlg(pParent)); + return VclPtr<AbstractScShowTabDlg_Impl>::Create(std::make_shared<ScShowTabDlg>(pParent)); } VclPtr<AbstractScStringInputDlg> ScAbstractDialogFactory_Impl::CreateScStringInputDlg(weld::Window* pParent, @@ -1164,7 +1164,7 @@ VclPtr<AbstractScImportOptionsDlg> ScAbstractDialogFactory_Impl::CreateScImportO VclPtr<SfxAbstractTabDialog> ScAbstractDialogFactory_Impl::CreateScAttrDlg(weld::Window* pParent, const SfxItemSet* pCellAttrs) { - return VclPtr<ScAbstractTabController_Impl>::Create(std::make_unique<ScAttrDlg>(pParent, pCellAttrs)); + return VclPtr<ScAbstractTabController_Impl>::Create(std::make_shared<ScAttrDlg>(pParent, pCellAttrs)); } VclPtr<SfxAbstractTabDialog> ScAbstractDialogFactory_Impl::CreateScHFEditDlg( weld::Window* pParent, @@ -1172,42 +1172,42 @@ VclPtr<SfxAbstractTabDialog> ScAbstractDialogFactory_Impl::CreateScHFEditDlg( we const OUString& rPageStyle, sal_uInt16 nResId ) { - std::unique_ptr<SfxTabDialogController> xDlg; + std::shared_ptr<SfxTabDialogController> xDlg; switch (nResId) { case RID_SCDLG_HFED_HEADER: case RID_SCDLG_HFEDIT_HEADER: - xDlg = std::make_unique<ScHFEditHeaderDlg>(pParent, rCoreSet, rPageStyle); + xDlg = std::make_shared<ScHFEditHeaderDlg>(pParent, rCoreSet, rPageStyle); break; case RID_SCDLG_HFED_FOOTER: case RID_SCDLG_HFEDIT_FOOTER: - xDlg = std::make_unique<ScHFEditFooterDlg>(pParent, rCoreSet, rPageStyle); + xDlg = std::make_shared<ScHFEditFooterDlg>(pParent, rCoreSet, rPageStyle); break; case RID_SCDLG_HFEDIT_LEFTHEADER: - xDlg = std::make_unique<ScHFEditLeftHeaderDlg>(pParent, rCoreSet, rPageStyle); + xDlg = std::make_shared<ScHFEditLeftHeaderDlg>(pParent, rCoreSet, rPageStyle); break; case RID_SCDLG_HFEDIT_RIGHTHEADER: - xDlg = std::make_unique<ScHFEditRightHeaderDlg>(pParent, rCoreSet, rPageStyle); + xDlg = std::make_shared<ScHFEditRightHeaderDlg>(pParent, rCoreSet, rPageStyle); break; case RID_SCDLG_HFEDIT_LEFTFOOTER: - xDlg = std::make_unique<ScHFEditLeftFooterDlg>(pParent, rCoreSet, rPageStyle); + xDlg = std::make_shared<ScHFEditLeftFooterDlg>(pParent, rCoreSet, rPageStyle); break; case RID_SCDLG_HFEDIT_RIGHTFOOTER: - xDlg = std::make_unique<ScHFEditRightFooterDlg>(pParent, rCoreSet, rPageStyle); + xDlg = std::make_shared<ScHFEditRightFooterDlg>(pParent, rCoreSet, rPageStyle); break; case RID_SCDLG_HFEDIT_SHDR: - xDlg = std::make_unique<ScHFEditSharedHeaderDlg>(pParent, rCoreSet, rPageStyle); + xDlg = std::make_shared<ScHFEditSharedHeaderDlg>(pParent, rCoreSet, rPageStyle); break; case RID_SCDLG_HFEDIT_SFTR: - xDlg = std::make_unique<ScHFEditSharedFooterDlg>(pParent, rCoreSet, rPageStyle); + xDlg = std::make_shared<ScHFEditSharedFooterDlg>(pParent, rCoreSet, rPageStyle); break; case RID_SCDLG_HFEDIT_ALL: - xDlg = std::make_unique<ScHFEditAllDlg>(pParent, rCoreSet, rPageStyle); + xDlg = std::make_shared<ScHFEditAllDlg>(pParent, rCoreSet, rPageStyle); break; default: case RID_SCDLG_HFEDIT: - xDlg = std::make_unique<ScHFEditActiveDlg>(pParent, rCoreSet, rPageStyle); + xDlg = std::make_shared<ScHFEditActiveDlg>(pParent, rCoreSet, rPageStyle); break; } @@ -1218,29 +1218,29 @@ VclPtr<SfxAbstractTabDialog> ScAbstractDialogFactory_Impl::CreateScStyleDlg(weld SfxStyleSheetBase& rStyleBase, bool bPage) { - return VclPtr<ScAbstractTabController_Impl>::Create(std::make_unique<ScStyleDlg>(pParent, rStyleBase, bPage)); + return VclPtr<ScAbstractTabController_Impl>::Create(std::make_shared<ScStyleDlg>(pParent, rStyleBase, bPage)); } VclPtr<SfxAbstractTabDialog> ScAbstractDialogFactory_Impl::CreateScSubTotalDlg(weld::Window* pParent, const SfxItemSet* pArgSet) { - return VclPtr<ScAbstractTabController_Impl>::Create(std::make_unique<ScSubTotalDlg>(pParent, pArgSet)); + return VclPtr<ScAbstractTabController_Impl>::Create(std::make_shared<ScSubTotalDlg>(pParent, pArgSet)); } VclPtr<SfxAbstractTabDialog> ScAbstractDialogFactory_Impl::CreateScCharDlg( weld::Window* pParent, const SfxItemSet* pAttr, const SfxObjectShell* pDocShell, bool bDrawText) { - return VclPtr<ScAbstractTabController_Impl>::Create(std::make_unique<ScCharDlg>(pParent, pAttr, pDocShell, bDrawText)); + return VclPtr<ScAbstractTabController_Impl>::Create(std::make_shared<ScCharDlg>(pParent, pAttr, pDocShell, bDrawText)); } VclPtr<SfxAbstractTabDialog> ScAbstractDialogFactory_Impl::CreateScParagraphDlg( weld::Window* pParent, const SfxItemSet* pAttr) { - return VclPtr<ScAbstractTabController_Impl>::Create(std::make_unique<ScParagraphDlg>(pParent, pAttr)); + return VclPtr<ScAbstractTabController_Impl>::Create(std::make_shared<ScParagraphDlg>(pParent, pAttr)); } VclPtr<SfxAbstractTabDialog> ScAbstractDialogFactory_Impl::CreateScSortDlg(weld::Window* pParent, const SfxItemSet* pArgSet) { - return VclPtr<ScAbstractTabController_Impl>::Create(std::make_unique<ScSortDlg>(pParent, pArgSet)); + return VclPtr<ScAbstractTabController_Impl>::Create(std::make_shared<ScSortDlg>(pParent, pArgSet)); } //------------------ Factories for TabPages-------------------- diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index 527a81e6e2d1..ddcdef3cadf7 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -103,7 +103,7 @@ class AbstractScImportAsciiDlg_Impl : public AbstractScImportAsciiDlg { std::shared_ptr<ScImportAsciiDlg> m_xDlg; public: - explicit AbstractScImportAsciiDlg_Impl(std::unique_ptr<ScImportAsciiDlg> p) + explicit AbstractScImportAsciiDlg_Impl(std::shared_ptr<ScImportAsciiDlg> p) : m_xDlg(std::move(p)) { } @@ -151,7 +151,7 @@ class AbstractScCondFormatManagerDlg_Impl : public AbstractScCondFormatManagerDl { std::shared_ptr<ScCondFormatManagerDlg> m_xDlg; public: - explicit AbstractScCondFormatManagerDlg_Impl(std::unique_ptr<ScCondFormatManagerDlg> p) + explicit AbstractScCondFormatManagerDlg_Impl(std::shared_ptr<ScCondFormatManagerDlg> p) : m_xDlg(std::move(p)) { } @@ -544,8 +544,8 @@ class AbstractScShowTabDlg_Impl : public AbstractScShowTabDlg { std::shared_ptr<ScShowTabDlg> m_xDlg; public: - explicit AbstractScShowTabDlg_Impl(ScShowTabDlg* p) - : m_xDlg(p) + explicit AbstractScShowTabDlg_Impl(std::shared_ptr<ScShowTabDlg> p) + : m_xDlg(std::move(p)) { } virtual short Execute() override; @@ -633,7 +633,7 @@ class ScAbstractTabController_Impl : public SfxAbstractTabDialog { std::shared_ptr<SfxTabDialogController> m_xDlg; public: - explicit ScAbstractTabController_Impl(std::unique_ptr<SfxTabDialogController> p) + explicit ScAbstractTabController_Impl(std::shared_ptr<SfxTabDialogController> p) : m_xDlg(std::move(p)) { } |