From 9b3dca4fef7cca1848e287ddb0f7af68808b6909 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 10 Jan 2021 20:37:40 +0000 Subject: CreateScSubTotalDlg always called with a non-null pArgSet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8a13a66ab7ce55a48896a921dc3b91594abefbc4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109068 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sc/inc/scabstdlg.hxx | 2 +- sc/source/ui/attrdlg/scdlgfact.cxx | 4 ++-- sc/source/ui/attrdlg/scdlgfact.hxx | 2 +- sc/source/ui/dbgui/subtdlg.cxx | 5 ++--- sc/source/ui/inc/subtdlg.hxx | 2 +- sc/source/ui/view/cellsh1.cxx | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index 1dc22aa88fea..e6971503a051 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -538,7 +538,7 @@ public: bool bPage /*true : page, false: para*/) = 0; virtual VclPtr CreateScSubTotalDlg(weld::Window* pParent, - const SfxItemSet* pArgSet) = 0; + const SfxItemSet& rArgSet) = 0; virtual VclPtr CreateScCharDlg(weld::Window* pParent, const SfxItemSet* pAttr, const SfxObjectShell* pDocShell, bool bDrawText) = 0; diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index 8eebc78003a4..061db5614a66 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -1244,9 +1244,9 @@ VclPtr ScAbstractDialogFactory_Impl::CreateScStyleDlg(weld return VclPtr::Create(std::make_shared(pParent, rStyleBase, bPage)); } -VclPtr ScAbstractDialogFactory_Impl::CreateScSubTotalDlg(weld::Window* pParent, const SfxItemSet* pArgSet) +VclPtr ScAbstractDialogFactory_Impl::CreateScSubTotalDlg(weld::Window* pParent, const SfxItemSet& rArgSet) { - return VclPtr::Create(std::make_shared(pParent, pArgSet)); + return VclPtr::Create(std::make_shared(pParent, rArgSet)); } VclPtr ScAbstractDialogFactory_Impl::CreateScCharDlg( diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index 6bf001f25919..980b3f4270bc 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -812,7 +812,7 @@ public: bool bPage) override; virtual VclPtr CreateScSubTotalDlg(weld::Window* pParent, - const SfxItemSet* pArgSet) override; + const SfxItemSet& rArgSet) override; virtual VclPtr CreateScCharDlg(weld::Window* pParent, const SfxItemSet* pAttr, const SfxObjectShell* pDocShell, bool bDrawText) override; diff --git a/sc/source/ui/dbgui/subtdlg.cxx b/sc/source/ui/dbgui/subtdlg.cxx index 36c692b2f37f..924716a6ff10 100644 --- a/sc/source/ui/dbgui/subtdlg.cxx +++ b/sc/source/ui/dbgui/subtdlg.cxx @@ -23,11 +23,10 @@ #include #include -ScSubTotalDlg::ScSubTotalDlg(weld::Window* pParent, const SfxItemSet* pArgSet) - : SfxTabDialogController(pParent, "modules/scalc/ui/subtotaldialog.ui", "SubTotalDialog", pArgSet) +ScSubTotalDlg::ScSubTotalDlg(weld::Window* pParent, const SfxItemSet& rArgSet) + : SfxTabDialogController(pParent, "modules/scalc/ui/subtotaldialog.ui", "SubTotalDialog", &rArgSet) , m_xBtnRemove(m_xBuilder->weld_button("remove")) { - AddTabPage("1stgroup", ScTpSubTotalGroup1::Create, nullptr); AddTabPage("2ndgroup", ScTpSubTotalGroup2::Create, nullptr); AddTabPage("3rdgroup", ScTpSubTotalGroup3::Create, nullptr); diff --git a/sc/source/ui/inc/subtdlg.hxx b/sc/source/ui/inc/subtdlg.hxx index d06c4ef2e57a..dc61b6cf4d1a 100644 --- a/sc/source/ui/inc/subtdlg.hxx +++ b/sc/source/ui/inc/subtdlg.hxx @@ -25,7 +25,7 @@ class ScSubTotalDlg : public SfxTabDialogController { public: - ScSubTotalDlg(weld::Window* pParent, const SfxItemSet* pArgSet); + ScSubTotalDlg(weld::Window* pParent, const SfxItemSet& rArgSet); virtual ~ScSubTotalDlg() override; private: diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 4a7324d43eb8..209172fc731b 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -3120,7 +3120,7 @@ void ScCellShell::ExecuteSubtotals(SfxRequest& rReq) aArgSet.Put( ScSubTotalItem( SCITEM_SUBTDATA, &GetViewData(), &aSubTotalParam ) ); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); - pDlg.disposeAndReset(pFact->CreateScSubTotalDlg(pTabViewShell->GetFrameWeld(), &aArgSet)); + pDlg.disposeAndReset(pFact->CreateScSubTotalDlg(pTabViewShell->GetFrameWeld(), aArgSet)); pDlg->SetCurPageId("1stgroup"); short bResult = pDlg->Execute(); -- cgit