diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-09-20 20:29:36 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-09-26 09:54:18 +0200 |
commit | a37e559ed123789f6bc8f7972242d6461ce692ab (patch) | |
tree | 7c6304b4541335b2bb706efda58b882132fe3819 /sw/source/ui/envelp | |
parent | b3f249c1351642be6f2774230ff80a6d20bd1401 (diff) |
disinherit OWizardPage and SfxTabPage from vcl TabPage
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 <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/ui/envelp')
-rw-r--r-- | sw/source/ui/envelp/envfmt.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/envelp/envfmt.hxx | 5 | ||||
-rw-r--r-- | sw/source/ui/envelp/envlop1.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/envelp/envprt.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/envelp/envprt.hxx | 10 | ||||
-rw-r--r-- | sw/source/ui/envelp/label1.cxx | 20 | ||||
-rw-r--r-- | sw/source/ui/envelp/labfmt.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/envelp/labfmt.hxx | 5 | ||||
-rw-r--r-- | sw/source/ui/envelp/labprt.cxx | 12 | ||||
-rw-r--r-- | sw/source/ui/envelp/labprt.hxx | 6 | ||||
-rw-r--r-- | sw/source/ui/envelp/swuilabimp.hxx | 15 |
11 files changed, 29 insertions, 64 deletions
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<SfxTabPage> SwEnvFormatPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> SwEnvFormatPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<SwEnvFormatPage>::Create(pParent, *rSet); + return std::make_unique<SwEnvFormatPage>(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<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet); + static std::unique_ptr<SfxTabPage> 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<SfxTabPage> SwEnvPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> SwEnvPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<SwEnvPage>::Create(pParent, *rSet); + return std::make_unique<SwEnvPage>(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<SfxTabPage> SwEnvPrtPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> SwEnvPrtPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<SwEnvPrtPage>::Create(pParent, *rSet); + return std::make_unique<SwEnvPrtPage>(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<SwEnvDlg*>(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<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet); + static std::unique_ptr<SfxTabPage> 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<SwLabPage*>(&rPage)->SetToBusinessCard(); } else if (rId == "options") - pPrtPage = static_cast<SwLabPrtPage*>(&rPage); + m_pPrtPage = static_cast<SwLabPrtPage*>(&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<SfxTabPage> SwLabPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> SwLabPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<SwLabPage>::Create(pParent, *rSet); + return std::make_unique<SwLabPage>(pParent, *rSet); } void SwLabPage::ActivatePage(const SfxItemSet& rSet) @@ -574,9 +574,9 @@ SwPrivateDataPage::~SwPrivateDataPage() { } -VclPtr<SfxTabPage> SwPrivateDataPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> SwPrivateDataPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<SwPrivateDataPage>::Create(pParent, *rSet); + return std::make_unique<SwPrivateDataPage>(pParent, *rSet); } void SwPrivateDataPage::ActivatePage(const SfxItemSet& rSet) @@ -667,9 +667,9 @@ SwBusinessDataPage::~SwBusinessDataPage() { } -VclPtr<SfxTabPage> SwBusinessDataPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> SwBusinessDataPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<SwBusinessDataPage>::Create(pParent, *rSet); + return std::make_unique<SwBusinessDataPage>(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<SfxTabPage> SwLabFormatPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> SwLabFormatPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<SwLabFormatPage>::Create(pParent, *rSet); + return std::make_unique<SwLabFormatPage>(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<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet); + static std::unique_ptr<SfxTabPage> 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 @@ -57,13 +57,7 @@ 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<Printer>::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<SfxTabPage> SwLabPrtPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> SwLabPrtPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<SwLabPrtPage>::Create(pParent, *rSet ); + return std::make_unique<SwLabPrtPage>(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<SwLabDlg*>(GetDialogController());} - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - public: SwLabPrtPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SwLabPrtPage() override; - virtual void dispose() override; - static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet); + static std::unique_ptr<SfxTabPage> 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<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet); + static std::unique_ptr<SfxTabPage> 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<weld::Entry> m_xHomePageED; std::unique_ptr<weld::Entry> m_xMailED; - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - public: SwPrivateDataPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SwPrivateDataPage() override; - static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet); + static std::unique_ptr<SfxTabPage> 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<weld::Entry> m_xHomePageED; std::unique_ptr<weld::Entry> m_xMailED; - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - public: SwBusinessDataPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SwBusinessDataPage() override; - static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet); + static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet); virtual void ActivatePage(const SfxItemSet& rSet) override; virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override; |