From a37e559ed123789f6bc8f7972242d6461ce692ab Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 20 Sep 2019 20:29:36 +0100 Subject: disinherit OWizardPage and SfxTabPage from vcl TabPage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that there's no need to support weld/unwelded mixes of pages in dialog any more. inherit from a BuilderPage which contains a Builder and Toplevel container BuilderPage Activate and Deactivate replace TabPage ActivatePage and DeactivatePage, allowing disambiguation wrt SfxTabPage ActivatePage and DeactivatePage. Change-Id: I5706e50fd92f712a25328ee9791e054bb9ad9812 Reviewed-on: https://gerrit.libreoffice.org/79317 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/source/ui/envelp/envfmt.cxx | 5 ++--- sw/source/ui/envelp/envfmt.hxx | 5 +---- sw/source/ui/envelp/envlop1.cxx | 5 ++--- sw/source/ui/envelp/envprt.cxx | 6 +++--- sw/source/ui/envelp/envprt.hxx | 10 +--------- sw/source/ui/envelp/label1.cxx | 20 ++++++++++---------- sw/source/ui/envelp/labfmt.cxx | 4 ++-- sw/source/ui/envelp/labfmt.hxx | 5 +---- sw/source/ui/envelp/labprt.cxx | 12 +++--------- sw/source/ui/envelp/labprt.hxx | 6 +----- sw/source/ui/envelp/swuilabimp.hxx | 15 +++------------ 11 files changed, 29 insertions(+), 64 deletions(-) (limited to 'sw/source/ui/envelp') diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx index 528d202cf477..12a3cd8a881e 100644 --- a/sw/source/ui/envelp/envfmt.cxx +++ b/sw/source/ui/envelp/envfmt.cxx @@ -187,7 +187,6 @@ void SwEnvFormatPage::Init(SwEnvDlg* pDialog) SwEnvFormatPage::~SwEnvFormatPage() { - disposeOnce(); } IMPL_LINK( SwEnvFormatPage, ModifyHdl, weld::MetricSpinButton&, rEdit, void ) @@ -413,9 +412,9 @@ void SwEnvFormatPage::SetMinMax() 100 * (getfieldval(*m_xAddrTopField ) - 2 * 566), FieldUnit::TWIP); } -VclPtr SwEnvFormatPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr SwEnvFormatPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr::Create(pParent, *rSet); + return std::make_unique(pParent, *rSet); } void SwEnvFormatPage::ActivatePage(const SfxItemSet& rSet) diff --git a/sw/source/ui/envelp/envfmt.hxx b/sw/source/ui/envelp/envfmt.hxx index 20f2bd3844b9..531e3401a8ea 100644 --- a/sw/source/ui/envelp/envfmt.hxx +++ b/sw/source/ui/envelp/envfmt.hxx @@ -54,15 +54,12 @@ class SwEnvFormatPage : public SfxTabPage SwEnvDlg *GetParentSwEnvDlg() { return m_pDialog; } - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - public: SwEnvFormatPage(TabPageParent pParent, const SfxItemSet& rSet); void Init(SwEnvDlg* pDialog); virtual ~SwEnvFormatPage() override; - static VclPtr Create(TabPageParent pParent, const SfxItemSet* rSet); + static std::unique_ptr Create(TabPageParent pParent, const SfxItemSet* rSet); virtual void ActivatePage(const SfxItemSet& rSet) override; virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override; diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx index f890236195cd..bf1871882cbc 100644 --- a/sw/source/ui/envelp/envlop1.cxx +++ b/sw/source/ui/envelp/envlop1.cxx @@ -226,7 +226,6 @@ void SwEnvPage::Init(SwEnvDlg* pDialog) SwEnvPage::~SwEnvPage() { - disposeOnce(); } IMPL_LINK( SwEnvPage, DatabaseHdl, weld::ComboBox&, rListBox, void ) @@ -298,9 +297,9 @@ void SwEnvPage::InitDatabaseBox() } } -VclPtr SwEnvPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr SwEnvPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr::Create(pParent, *rSet); + return std::make_unique(pParent, *rSet); } void SwEnvPage::ActivatePage(const SfxItemSet& rSet) diff --git a/sw/source/ui/envelp/envprt.cxx b/sw/source/ui/envelp/envprt.cxx index cc62d67becdc..fdfca438189e 100644 --- a/sw/source/ui/envelp/envprt.cxx +++ b/sw/source/ui/envelp/envprt.cxx @@ -76,7 +76,7 @@ SwEnvPrtPage::SwEnvPrtPage(TabPageParent pParent, const SfxItemSet& rSet) SwEnvPrtPage::~SwEnvPrtPage() { - disposeOnce(); + m_xPrt.clear(); } IMPL_LINK_NOARG(SwEnvPrtPage, ClickHdl, weld::ToggleButton&, void) @@ -127,9 +127,9 @@ IMPL_LINK(SwEnvPrtPage, ButtonHdl, weld::Button&, rBtn, void) } } -VclPtr SwEnvPrtPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr SwEnvPrtPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr::Create(pParent, *rSet); + return std::make_unique(pParent, *rSet); } void SwEnvPrtPage::ActivatePage(const SfxItemSet&) diff --git a/sw/source/ui/envelp/envprt.hxx b/sw/source/ui/envelp/envprt.hxx index 6e5e7d9ea8c6..e86c0df1a582 100644 --- a/sw/source/ui/envelp/envprt.hxx +++ b/sw/source/ui/envelp/envprt.hxx @@ -53,19 +53,11 @@ class SwEnvPrtPage : public SfxTabPage SwEnvDlg* GetParentSwEnvDlg() {return static_cast(GetDialogController()); } - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - public: SwEnvPrtPage(TabPageParent pParent, const SfxItemSet& rSet); - virtual void dispose() override - { - m_xPrt.clear(); - SfxTabPage::dispose(); - } virtual ~SwEnvPrtPage() override; - static VclPtr Create(TabPageParent pParent, const SfxItemSet* rSet); + static std::unique_ptr Create(TabPageParent pParent, const SfxItemSet* rSet); virtual void ActivatePage(const SfxItemSet& rSet) override; virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override; diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx index e1e42ba1ef64..1a64abb75f99 100644 --- a/sw/source/ui/envelp/label1.cxx +++ b/sw/source/ui/envelp/label1.cxx @@ -90,14 +90,14 @@ void SwLabDlg::PageCreated(const OString &rId, SfxTabPage &rPage) static_cast(&rPage)->SetToBusinessCard(); } else if (rId == "options") - pPrtPage = static_cast(&rPage); + m_pPrtPage = static_cast(&rPage); } SwLabDlg::SwLabDlg(weld::Window* pParent, const SfxItemSet& rSet, SwDBManager* pDBManager_, bool bLabel) : SfxTabDialogController(pParent, "modules/swriter/ui/labeldialog.ui", "LabelDialog", &rSet) , pDBManager(pDBManager_) - , pPrtPage(nullptr) + , m_pPrtPage(nullptr) , aTypeIds(50, 10) , m_pRecs(new SwLabRecs) , m_bLabel(bLabel) @@ -214,8 +214,8 @@ SwLabRec* SwLabDlg::GetRecord(const OUString &rRecName, bool bCont) Printer *SwLabDlg::GetPrt() { - if (pPrtPage) - return pPrtPage->GetPrt(); + if (m_pPrtPage) + return m_pPrtPage->GetPrt(); else return nullptr; } @@ -446,9 +446,9 @@ void SwLabPage::InitDatabaseBox() } } -VclPtr SwLabPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr SwLabPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr::Create(pParent, *rSet); + return std::make_unique(pParent, *rSet); } void SwLabPage::ActivatePage(const SfxItemSet& rSet) @@ -574,9 +574,9 @@ SwPrivateDataPage::~SwPrivateDataPage() { } -VclPtr SwPrivateDataPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr SwPrivateDataPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr::Create(pParent, *rSet); + return std::make_unique(pParent, *rSet); } void SwPrivateDataPage::ActivatePage(const SfxItemSet& rSet) @@ -667,9 +667,9 @@ SwBusinessDataPage::~SwBusinessDataPage() { } -VclPtr SwBusinessDataPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr SwBusinessDataPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr::Create(pParent, *rSet); + return std::make_unique(pParent, *rSet); } void SwBusinessDataPage::ActivatePage(const SfxItemSet& rSet) diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx index 7f2d9ece02ba..91442147431e 100644 --- a/sw/source/ui/envelp/labfmt.cxx +++ b/sw/source/ui/envelp/labfmt.cxx @@ -403,9 +403,9 @@ void SwLabFormatPage::ChangeMinMax() m_xPHeightField->set_range(long(100) * lMinPHeight, long(100) * lMax, FieldUnit::TWIP); } -VclPtr SwLabFormatPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr SwLabFormatPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr::Create(pParent, *rSet); + return std::make_unique(pParent, *rSet); } void SwLabFormatPage::ActivatePage(const SfxItemSet& rSet) diff --git a/sw/source/ui/envelp/labfmt.hxx b/sw/source/ui/envelp/labfmt.hxx index 208b1bc1ac28..f4d55963cec1 100644 --- a/sw/source/ui/envelp/labfmt.hxx +++ b/sw/source/ui/envelp/labfmt.hxx @@ -95,14 +95,11 @@ class SwLabFormatPage : public SfxTabPage void ChangeMinMax(); - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - public: SwLabFormatPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SwLabFormatPage() override; - static VclPtr Create(TabPageParent pParent, const SfxItemSet* rSet); + static std::unique_ptr Create(TabPageParent pParent, const SfxItemSet* rSet); virtual void ActivatePage(const SfxItemSet& rSet) override; virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override; diff --git a/sw/source/ui/envelp/labprt.cxx b/sw/source/ui/envelp/labprt.cxx index 337ae9614e8e..cefe4136f3c8 100644 --- a/sw/source/ui/envelp/labprt.cxx +++ b/sw/source/ui/envelp/labprt.cxx @@ -56,14 +56,8 @@ SwLabPrtPage::SwLabPrtPage(TabPageParent pParent, const SfxItemSet& rSet) } SwLabPrtPage::~SwLabPrtPage() -{ - disposeOnce(); -} - -void SwLabPrtPage::dispose() { pPrinter.disposeAndClear(); - SfxTabPage::dispose(); } IMPL_LINK( SwLabPrtPage, CountHdl, weld::Button&, rButton, void ) @@ -74,7 +68,7 @@ IMPL_LINK( SwLabPrtPage, CountHdl, weld::Button&, rButton, void ) if (!pPrinter) pPrinter = VclPtr::Create(); - PrinterSetupDialog aDlg(GetFrameWeld()); + PrinterSetupDialog aDlg(GetDialogFrameWeld()); aDlg.SetPrinter(pPrinter); aDlg.run(); rButton.grab_focus(); @@ -92,9 +86,9 @@ IMPL_LINK( SwLabPrtPage, CountHdl, weld::Button&, rButton, void ) } } -VclPtr SwLabPrtPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr SwLabPrtPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr::Create(pParent, *rSet ); + return std::make_unique(pParent, *rSet ); } void SwLabPrtPage::ActivatePage( const SfxItemSet& rSet ) diff --git a/sw/source/ui/envelp/labprt.hxx b/sw/source/ui/envelp/labprt.hxx index f253653d3d1c..8c35033ded01 100644 --- a/sw/source/ui/envelp/labprt.hxx +++ b/sw/source/ui/envelp/labprt.hxx @@ -44,15 +44,11 @@ class SwLabPrtPage : public SfxTabPage SwLabDlg* GetParentSwLabDlg() {return static_cast(GetDialogController());} - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - public: SwLabPrtPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SwLabPrtPage() override; - virtual void dispose() override; - static VclPtr Create(TabPageParent pParent, const SfxItemSet* rSet); + static std::unique_ptr Create(TabPageParent pParent, const SfxItemSet* rSet); virtual void ActivatePage(const SfxItemSet& rSet) override; virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override; diff --git a/sw/source/ui/envelp/swuilabimp.hxx b/sw/source/ui/envelp/swuilabimp.hxx index f426694db434..ff81d3bfe17e 100644 --- a/sw/source/ui/envelp/swuilabimp.hxx +++ b/sw/source/ui/envelp/swuilabimp.hxx @@ -54,15 +54,12 @@ class SwLabPage : public SfxTabPage void DisplayFormat (); SwLabRec* GetSelectedEntryPos(); - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - public: SwLabPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SwLabPage() override; - static VclPtr Create(TabPageParent pParent, const SfxItemSet* rSet); + static std::unique_ptr Create(TabPageParent pParent, const SfxItemSet* rSet); virtual void ActivatePage(const SfxItemSet& rSet) override; virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override; @@ -100,14 +97,11 @@ class SwPrivateDataPage : public SfxTabPage std::unique_ptr m_xHomePageED; std::unique_ptr m_xMailED; - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - public: SwPrivateDataPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SwPrivateDataPage() override; - static VclPtr Create(TabPageParent pParent, const SfxItemSet* rSet); + static std::unique_ptr Create(TabPageParent pParent, const SfxItemSet* rSet); virtual void ActivatePage(const SfxItemSet& rSet) override; virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override; @@ -132,14 +126,11 @@ class SwBusinessDataPage : public SfxTabPage std::unique_ptr m_xHomePageED; std::unique_ptr m_xMailED; - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - public: SwBusinessDataPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SwBusinessDataPage() override; - static VclPtr Create(TabPageParent pParent, const SfxItemSet* rSet); + static std::unique_ptr Create(TabPageParent pParent, const SfxItemSet* rSet); virtual void ActivatePage(const SfxItemSet& rSet) override; virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override; -- cgit