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 | |
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')
58 files changed, 202 insertions, 372 deletions
diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx index 06b3cedd074b..68eba76bdb55 100644 --- a/sw/source/ui/chrdlg/chardlg.cxx +++ b/sw/source/ui/chrdlg/chardlg.cxx @@ -190,13 +190,7 @@ SwCharURLPage::SwCharURLPage(TabPageParent pParent, const SfxItemSet& rCoreSet) SwCharURLPage::~SwCharURLPage() { - disposeOnce(); -} - -void SwCharURLPage::dispose() -{ pINetItem.reset(); - SfxTabPage::dispose(); } void SwCharURLPage::Reset(const SfxItemSet* rSet) @@ -290,15 +284,15 @@ bool SwCharURLPage::FillItemSet(SfxItemSet* rSet) return bModified; } -VclPtr<SfxTabPage> SwCharURLPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) +std::unique_ptr<SfxTabPage> SwCharURLPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SwCharURLPage>::Create(pParent, *rAttrSet); + return std::make_unique<SwCharURLPage>(pParent, *rAttrSet); } IMPL_LINK_NOARG(SwCharURLPage, InsertFileHdl, weld::Button&, void) { FileDialogHelper aDlgHelper(TemplateDescription::FILEOPEN_SIMPLE, - FileDialogFlags::NONE, GetFrameWeld()); + FileDialogFlags::NONE, GetDialogFrameWeld()); if( aDlgHelper.Execute() == ERRCODE_NONE ) { const Reference<XFilePicker3>& xFP = aDlgHelper.GetFilePicker(); diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index 5cd01dd96867..82ab519c4b60 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -454,9 +454,9 @@ SwDropCapsDlg::SwDropCapsDlg(weld::Window *pParent, const SfxItemSet &rSet) : SfxSingleTabDialogController(pParent, &rSet) { TabPageParent pPageParent(get_content_area(), this); - VclPtr<SwDropCapsPage> xNewPage(static_cast<SwDropCapsPage*>(SwDropCapsPage::Create(pPageParent, &rSet).get())); - xNewPage->SetFormat(false); - SetTabPage(xNewPage); + auto xNewPage(SwDropCapsPage::Create(pPageParent, &rSet)); + static_cast<SwDropCapsPage*>(xNewPage.get())->SetFormat(false); + SetTabPage(std::move(xNewPage)); } SwDropCapsPage::SwDropCapsPage(TabPageParent pParent, const SfxItemSet &rSet) @@ -520,10 +520,9 @@ DeactivateRC SwDropCapsPage::DeactivatePage(SfxItemSet * _pSet) return DeactivateRC::LeavePage; } -VclPtr<SfxTabPage> SwDropCapsPage::Create(TabPageParent pParent, - const SfxItemSet *rSet) +std::unique_ptr<SfxTabPage> SwDropCapsPage::Create(TabPageParent pParent, const SfxItemSet *rSet) { - return VclPtr<SwDropCapsPage>::Create(pParent, *rSet); + return std::make_unique<SwDropCapsPage>(pParent, *rSet); } bool SwDropCapsPage::FillItemSet(SfxItemSet *rSet) diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx index 09a5e3c3f5a9..83ed68c907ac 100644 --- a/sw/source/ui/chrdlg/numpara.cxx +++ b/sw/source/ui/chrdlg/numpara.cxx @@ -98,9 +98,9 @@ SwParagraphNumTabPage::~SwParagraphNumTabPage() { } -VclPtr<SfxTabPage> SwParagraphNumTabPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> SwParagraphNumTabPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<SwParagraphNumTabPage>::Create(pParent, *rSet); + return std::make_unique<SwParagraphNumTabPage>(pParent, *rSet); } bool SwParagraphNumTabPage::FillItemSet( SfxItemSet* rSet ) diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx index e3cfd14e3e66..36bac20761bc 100644 --- a/sw/source/ui/chrdlg/swuiccoll.cxx +++ b/sw/source/ui/chrdlg/swuiccoll.cxx @@ -101,7 +101,6 @@ SwCondCollPage::SwCondCollPage(TabPageParent pParent, const SfxItemSet &rSet) SwCondCollPage::~SwCondCollPage() { - disposeOnce(); } DeactivateRC SwCondCollPage::DeactivatePage(SfxItemSet * _pSet) @@ -112,9 +111,9 @@ DeactivateRC SwCondCollPage::DeactivatePage(SfxItemSet * _pSet) return DeactivateRC::LeavePage; } -VclPtr<SfxTabPage> SwCondCollPage::Create(TabPageParent pParent, const SfxItemSet *rSet) +std::unique_ptr<SfxTabPage> SwCondCollPage::Create(TabPageParent pParent, const SfxItemSet *rSet) { - return VclPtr<SwCondCollPage>::Create(pParent, *rSet); + return std::make_unique<SwCondCollPage>(pParent, *rSet); } bool SwCondCollPage::FillItemSet(SfxItemSet *rSet) diff --git a/sw/source/ui/chrdlg/tblnumfm.cxx b/sw/source/ui/chrdlg/tblnumfm.cxx index e6722617176e..cb227959eefe 100644 --- a/sw/source/ui/chrdlg/tblnumfm.cxx +++ b/sw/source/ui/chrdlg/tblnumfm.cxx @@ -36,11 +36,11 @@ SwNumFormatDlg::SwNumFormatDlg(weld::Widget* pParent, const SfxItemSet& rSet) if ( fnCreatePage ) { TabPageParent pPageParent(get_content_area(), this); - VclPtr<SfxTabPage> xNewPage = (*fnCreatePage)(pPageParent, &rSet); + std::unique_ptr<SfxTabPage> xNewPage = (*fnCreatePage)(pPageParent, &rSet); SfxAllItemSet aSet(*(rSet.GetPool())); aSet.Put(xNewPage->GetItemSet().Get( SID_ATTR_NUMBERFORMAT_INFO)); xNewPage->PageCreated(aSet); - SetTabPage(xNewPage); + SetTabPage(std::move(xNewPage)); } } diff --git a/sw/source/ui/config/mailconfigpage.cxx b/sw/source/ui/config/mailconfigpage.cxx index a4c8a1f3a7a8..eff36f3e1f54 100644 --- a/sw/source/ui/config/mailconfigpage.cxx +++ b/sw/source/ui/config/mailconfigpage.cxx @@ -47,7 +47,7 @@ class SwTestAccountSettingsDialog : public SfxDialogController OUString m_sErrorServer; bool m_bStop; - VclPtr<SwMailConfigPage> m_pParent; + SwMailConfigPage* m_pParent; std::unique_ptr<weld::Button> m_xStopPB; std::unique_ptr<weld::TextView> m_xErrorsED; @@ -125,18 +125,12 @@ SwMailConfigPage::SwMailConfigPage(TabPageParent pParent, const SfxItemSet& rSet SwMailConfigPage::~SwMailConfigPage() { - disposeOnce(); -} - -void SwMailConfigPage::dispose() -{ m_pConfigItem.reset(); - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> SwMailConfigPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) +std::unique_ptr<SfxTabPage> SwMailConfigPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SwMailConfigPage>::Create(pParent, *rAttrSet); + return std::make_unique<SwMailConfigPage>(pParent, *rAttrSet); } bool SwMailConfigPage::FillItemSet( SfxItemSet* /*rSet*/ ) diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx index 3eb50d8ed913..4dfac04edb27 100644 --- a/sw/source/ui/config/optcomp.cxx +++ b/sw/source/ui/config/optcomp.cxx @@ -340,9 +340,9 @@ void SwCompatibilityOptPage::WriteOptions() m_aConfigItem.AppendItem(rItem); } -VclPtr<SfxTabPage> SwCompatibilityOptPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) +std::unique_ptr<SfxTabPage> SwCompatibilityOptPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SwCompatibilityOptPage>::Create( pParent, *rAttrSet ); + return std::make_unique<SwCompatibilityOptPage>(pParent, *rAttrSet); } bool SwCompatibilityOptPage::FillItemSet( SfxItemSet* ) diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index 0af4778387fe..59bcb5cff276 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -145,10 +145,10 @@ SwLoadOptPage::~SwLoadOptPage() { } -VclPtr<SfxTabPage> SwLoadOptPage::Create( TabPageParent pParent, +std::unique_ptr<SfxTabPage> SwLoadOptPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<SwLoadOptPage>::Create(pParent, *rAttrSet ); + return std::make_unique<SwLoadOptPage>(pParent, *rAttrSet ); } IMPL_LINK_NOARG(SwLoadOptPage, StandardizedPageCountCheckHdl, weld::Button&, void) @@ -540,21 +540,15 @@ SwCaptionOptPage::SwCaptionOptPage(TabPageParent pParent, const SfxItemSet& rSet SwCaptionOptPage::~SwCaptionOptPage() { - disposeOnce(); -} - -void SwCaptionOptPage::dispose() -{ DelUserData(); pMgr.reset(); m_xPreview.reset(); - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> SwCaptionOptPage::Create(TabPageParent pParent, +std::unique_ptr<SfxTabPage> SwCaptionOptPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SwCaptionOptPage>::Create(pParent, *rAttrSet); + return std::make_unique<SwCaptionOptPage>(pParent, *rAttrSet); } bool SwCaptionOptPage::FillItemSet( SfxItemSet* ) diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 065af21e86c6..8f5a0ed6106c 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -170,10 +170,10 @@ SwContentOptPage::~SwContentOptPage() { } -VclPtr<SfxTabPage> SwContentOptPage::Create( TabPageParent pParent, +std::unique_ptr<SfxTabPage> SwContentOptPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SwContentOptPage>::Create(pParent, *rAttrSet); + return std::make_unique<SwContentOptPage>(pParent, *rAttrSet); } static void lcl_SelectMetricLB(weld::ComboBox& rMetric, sal_uInt16 nSID, const SfxItemSet& rSet) @@ -350,10 +350,10 @@ void SwAddPrinterTabPage::SetPreview(bool bPrev) m_xPagesFrame->set_sensitive(!bPreview); } -VclPtr<SfxTabPage> SwAddPrinterTabPage::Create( TabPageParent pParent, +std::unique_ptr<SfxTabPage> SwAddPrinterTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<SwAddPrinterTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SwAddPrinterTabPage>(pParent, *rAttrSet); } bool SwAddPrinterTabPage::FillItemSet( SfxItemSet* rCoreSet ) @@ -544,11 +544,6 @@ SwStdFontTabPage::SwStdFontTabPage(TabPageParent pParent, const SfxItemSet& rSet SwStdFontTabPage::~SwStdFontTabPage() { - disposeOnce(); -} - -void SwStdFontTabPage::dispose() -{ m_xIndexHeightLB.reset(); m_xLabelHeightLB.reset(); m_xListHeightLB.reset(); @@ -559,13 +554,12 @@ void SwStdFontTabPage::dispose() m_pPrt.disposeAndClear(); else m_pPrt.clear(); - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> SwStdFontTabPage::Create( TabPageParent pParent, +std::unique_ptr<SfxTabPage> SwStdFontTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<SwStdFontTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SwStdFontTabPage>(pParent, *rAttrSet); } static void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType, @@ -1031,10 +1025,10 @@ SwTableOptionsTabPage::~SwTableOptionsTabPage() { } -VclPtr<SfxTabPage> SwTableOptionsTabPage::Create( TabPageParent pParent, +std::unique_ptr<SfxTabPage> SwTableOptionsTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<SwTableOptionsTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SwTableOptionsTabPage>(pParent, *rAttrSet); } bool SwTableOptionsTabPage::FillItemSet( SfxItemSet* ) @@ -1264,9 +1258,9 @@ SwShdwCursorOptionsTabPage::~SwShdwCursorOptionsTabPage() { } -VclPtr<SfxTabPage> SwShdwCursorOptionsTabPage::Create( TabPageParent pParent, const SfxItemSet* rSet ) +std::unique_ptr<SfxTabPage> SwShdwCursorOptionsTabPage::Create( TabPageParent pParent, const SfxItemSet* rSet ) { - return VclPtr<SwShdwCursorOptionsTabPage>::Create( pParent, *rSet ); + return std::make_unique<SwShdwCursorOptionsTabPage>(pParent, *rSet ); } void SwShdwCursorOptionsTabPage::PageCreated( const SfxAllItemSet& aSet ) @@ -1630,11 +1624,6 @@ SwRedlineOptionsTabPage::SwRedlineOptionsTabPage(TabPageParent pParent, SwRedlineOptionsTabPage::~SwRedlineOptionsTabPage() { - disposeOnce(); -} - -void SwRedlineOptionsTabPage::dispose() -{ m_xInsertColorLB.reset(); m_xInsertedPreview.reset(); m_xInsertedPreviewWN.reset(); @@ -1647,12 +1636,11 @@ void SwRedlineOptionsTabPage::dispose() m_xMarkColorLB.reset(); m_xMarkPreview.reset(); m_xMarkPreviewWN.reset(); - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> SwRedlineOptionsTabPage::Create( TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> SwRedlineOptionsTabPage::Create( TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<SwRedlineOptionsTabPage>::Create( pParent, *rSet ); + return std::make_unique<SwRedlineOptionsTabPage>(pParent, *rSet ); } bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet* ) @@ -2038,9 +2026,9 @@ SwCompareOptionsTabPage::~SwCompareOptionsTabPage() { } -VclPtr<SfxTabPage> SwCompareOptionsTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) +std::unique_ptr<SfxTabPage> SwCompareOptionsTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<SwCompareOptionsTabPage>::Create( pParent, *rAttrSet ); + return std::make_unique<SwCompareOptionsTabPage>(pParent, *rAttrSet ); } bool SwCompareOptionsTabPage::FillItemSet( SfxItemSet* ) @@ -2170,10 +2158,10 @@ SwTestTabPage::~SwTestTabPage() { } -VclPtr<SfxTabPage> SwTestTabPage::Create( TabPageParent pParent, +std::unique_ptr<SfxTabPage> SwTestTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<SwTestTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SwTestTabPage>(pParent, *rAttrSet); } bool SwTestTabPage::FillItemSet( SfxItemSet* rCoreSet ) diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index 56b4801ddf55..e4d6792d6c7f 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -122,7 +122,7 @@ static OUString lcl_getFlatURL( uno::Reference<beans::XPropertySet> const & xSou SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent) : SfxDialogController(pParent->GetWizard()->getDialog(), "modules/swriter/ui/selectaddressdialog.ui", "SelectAddressDialog") , m_bInSelectHdl(false) - , m_xAddressPage(pParent) + , m_pAddressPage(pParent) , m_xDescriptionFI(m_xBuilder->weld_label("desc")) , m_xConnecting(m_xBuilder->weld_label("connecting")) , m_xListLB(m_xBuilder->weld_tree_view("sources")) @@ -161,7 +161,7 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent) uno::Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() ); m_xDBContext = DatabaseContext::create(xContext); - SwMailMergeConfigItem& rConfigItem = m_xAddressPage->GetWizard()->GetConfigItem(); + SwMailMergeConfigItem& rConfigItem = m_pAddressPage->GetWizard()->GetConfigItem(); const SwDBData& rCurrentData = rConfigItem.GetCurrentDBData(); bool bEnableEdit = false; @@ -276,7 +276,7 @@ IMPL_LINK_NOARG(SwAddressListDialog, FilterHdl_Impl, weld::Button&, void) IMPL_LINK_NOARG(SwAddressListDialog, LoadHdl_Impl, weld::Button&, void) { - SwView* pView = m_xAddressPage->GetWizard()->GetSwView(); + SwView* pView = m_pAddressPage->GetWizard()->GetSwView(); const OUString sNewSource = SwDBManager::LoadAndRegisterDataSource(m_xDialog.get(), pView ? pView->GetDocShell() : nullptr); if(!sNewSource.isEmpty()) @@ -320,7 +320,7 @@ IMPL_LINK_NOARG(SwAddressListDialog, RemoveHdl_Impl, weld::Button&, void) IMPL_LINK_NOARG(SwAddressListDialog, CreateHdl_Impl, weld::Button&, void) { - SwCreateAddressListDialog aDlg(m_xDialog.get(), /*sInputURL*/OUString(), m_xAddressPage->GetWizard()->GetConfigItem()); + SwCreateAddressListDialog aDlg(m_xDialog.get(), /*sInputURL*/OUString(), m_pAddressPage->GetWizard()->GetConfigItem()); if (RET_OK == aDlg.run()) { //register the URL a new datasource @@ -400,7 +400,7 @@ IMPL_LINK_NOARG(SwAddressListDialog, EditHdl_Impl, weld::Button&, void) { if(pUserData->xResultSet.is()) { - SwMailMergeConfigItem& rConfigItem = m_xAddressPage->GetWizard()->GetConfigItem(); + SwMailMergeConfigItem& rConfigItem = m_pAddressPage->GetWizard()->GetConfigItem(); if(rConfigItem.GetResultSet() != pUserData->xResultSet) ::comphelper::disposeComponent( pUserData->xResultSet ); pUserData->xResultSet = nullptr; @@ -412,7 +412,7 @@ IMPL_LINK_NOARG(SwAddressListDialog, EditHdl_Impl, weld::Button&, void) pUserData->xConnection.clear(); // will automatically close if it was the las reference SwCreateAddressListDialog aDlg(m_xDialog.get(), pUserData->sURL, - m_xAddressPage->GetWizard()->GetConfigItem()); + m_pAddressPage->GetWizard()->GetConfigItem()); aDlg.run(); } }; diff --git a/sw/source/ui/dbui/addresslistdialog.hxx b/sw/source/ui/dbui/addresslistdialog.hxx index 167cf6ad638a..bf2d04121941 100644 --- a/sw/source/ui/dbui/addresslistdialog.hxx +++ b/sw/source/ui/dbui/addresslistdialog.hxx @@ -47,7 +47,7 @@ class SwAddressListDialog : public SfxDialogController bool m_bInSelectHdl; - VclPtr<SwMailMergeAddressBlockPage> m_xAddressPage; + SwMailMergeAddressBlockPage* m_pAddressPage; css::uno::Reference< css::sdb::XDatabaseContext> m_xDBContext; diff --git a/sw/source/ui/dbui/mailmergewizard.cxx b/sw/source/ui/dbui/mailmergewizard.cxx index f7b6362ddbf0..ceea20e79223 100644 --- a/sw/source/ui/dbui/mailmergewizard.cxx +++ b/sw/source/ui/dbui/mailmergewizard.cxx @@ -88,18 +88,18 @@ SwMailMergeWizard::~SwMailMergeWizard() { } -VclPtr<TabPage> SwMailMergeWizard::createPage(WizardState _nState) +std::unique_ptr<BuilderPage> SwMailMergeWizard::createPage(WizardState _nState) { OString sIdent(OString::number(_nState)); weld::Container* pPageContainer = m_xAssistant->append_page(sIdent); // TODO eventually pass DialogController as distinct argument instead of bundling into TabPageParent TabPageParent aParent(pPageContainer, this); - VclPtr<vcl::OWizardPage> pRet; + std::unique_ptr<vcl::OWizardPage> xRet; switch(_nState) { case MM_DOCUMENTSELECTPAGE : - pRet = VclPtr<SwMailMergeDocSelectPage>::Create(this, aParent); + xRet = std::make_unique<SwMailMergeDocSelectPage>(this, aParent); /* tdf#52986 Set help ID using SetRoadmapHelpId for all pages so that when by default the focus is on the left side pane of @@ -108,28 +108,27 @@ VclPtr<TabPage> SwMailMergeWizard::createPage(WizardState _nState) SetRoadmapHelpId("modules/swriter/ui/mmselectpage/MMSelectPage"); break; case MM_OUTPUTTYPETPAGE : - pRet = VclPtr<SwMailMergeOutputTypePage>::Create(this, aParent); + xRet = std::make_unique<SwMailMergeOutputTypePage>(this, aParent); SetRoadmapHelpId("modules/swriter/ui/mmoutputtypepage/MMOutputTypePage"); break; case MM_ADDRESSBLOCKPAGE : - pRet = VclPtr<SwMailMergeAddressBlockPage>::Create(this, aParent); + xRet = std::make_unique<SwMailMergeAddressBlockPage>(this, aParent); SetRoadmapHelpId("modules/swriter/ui/mmaddressblockpage/MMAddressBlockPage"); break; case MM_GREETINGSPAGE : - pRet = VclPtr<SwMailMergeGreetingsPage>::Create(this, aParent); + xRet = std::make_unique<SwMailMergeGreetingsPage>(this, aParent); SetRoadmapHelpId("modules/swriter/ui/mmsalutationpage/MMSalutationPage"); break; case MM_LAYOUTPAGE : - pRet = VclPtr<SwMailMergeLayoutPage>::Create(this, aParent); + xRet = std::make_unique<SwMailMergeLayoutPage>(this, aParent); SetRoadmapHelpId("modules/swriter/ui/mmlayoutpage/MMLayoutPage"); break; } m_xAssistant->set_page_title(sIdent, getStateDisplayName(_nState)); - - OSL_ENSURE(pRet, "no page created in ::createPage"); - return pRet; + OSL_ENSURE(xRet, "no page created in ::createPage"); + return xRet; } void SwMailMergeWizard::enterState( WizardState _nState ) @@ -199,7 +198,7 @@ void SwMailMergeWizard::UpdateRoadmap() // enableState( <page id>, false ); const sal_uInt16 nCurPage = m_xAssistant->get_current_page(); - TabPage* pCurPage = GetPage( nCurPage ); + BuilderPage* pCurPage = GetPage( nCurPage ); if(!pCurPage) return; bool bAddressFieldsConfigured = !m_xConfigItem->IsOutputToLetter() || diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx index ad9772abd592..da1fef364351 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.cxx +++ b/sw/source/ui/dbui/mmaddressblockpage.cxx @@ -109,17 +109,10 @@ SwMailMergeAddressBlockPage::SwMailMergeAddressBlockPage(SwMailMergeWizard* pWiz SwMailMergeAddressBlockPage::~SwMailMergeAddressBlockPage() { - disposeOnce(); -} - -void SwMailMergeAddressBlockPage::dispose() -{ m_xPreviewWIN.reset(); m_xSettingsWIN.reset(); m_xPreview.reset(); m_xSettings.reset(); - - vcl::OWizardPage::dispose(); } bool SwMailMergeAddressBlockPage::canAdvance() const @@ -127,7 +120,7 @@ bool SwMailMergeAddressBlockPage::canAdvance() const return m_pWizard->GetConfigItem().GetResultSet().is(); } -void SwMailMergeAddressBlockPage::ActivatePage() +void SwMailMergeAddressBlockPage::Activate() { SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); bool bIsLetter = rConfigItem.IsOutputToLetter(); diff --git a/sw/source/ui/dbui/mmaddressblockpage.hxx b/sw/source/ui/dbui/mmaddressblockpage.hxx index 9b3111fd82c9..0e76558d1c90 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.hxx +++ b/sw/source/ui/dbui/mmaddressblockpage.hxx @@ -77,14 +77,13 @@ class SwMailMergeAddressBlockPage : public vcl::OWizardPage void EnableAddressBlock(bool bAll, bool bSelective); - virtual void ActivatePage() override; + virtual void Activate() override; virtual bool commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) override; virtual bool canAdvance() const override; public: SwMailMergeAddressBlockPage(SwMailMergeWizard* pWizard, TabPageParent pParent); virtual ~SwMailMergeAddressBlockPage() override; - virtual void dispose() override; SwMailMergeWizard* GetWizard() { return m_pWizard; } }; diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx index 0aa4470ea078..83509f31d788 100644 --- a/sw/source/ui/dbui/mmgreetingspage.cxx +++ b/sw/source/ui/dbui/mmgreetingspage.cxx @@ -247,17 +247,11 @@ SwMailMergeGreetingsPage::SwMailMergeGreetingsPage(SwMailMergeWizard* pWizard, T SwMailMergeGreetingsPage::~SwMailMergeGreetingsPage() { - disposeOnce(); -} - -void SwMailMergeGreetingsPage::dispose() -{ m_xPreviewWIN.reset(); m_xPreview.reset(); - vcl::OWizardPage::dispose(); } -void SwMailMergeGreetingsPage::ActivatePage() +void SwMailMergeGreetingsPage::Activate() { //try to find the gender setting m_xFemaleColumnLB->clear(); diff --git a/sw/source/ui/dbui/mmgreetingspage.hxx b/sw/source/ui/dbui/mmgreetingspage.hxx index a50d52614d24..576fb98ea1bc 100644 --- a/sw/source/ui/dbui/mmgreetingspage.hxx +++ b/sw/source/ui/dbui/mmgreetingspage.hxx @@ -103,12 +103,11 @@ class SwMailMergeGreetingsPage : public vcl::OWizardPage DECL_LINK(AssignHdl_Impl, weld::Button&, void); virtual void UpdatePreview() override; - virtual void ActivatePage() override; + virtual void Activate() override; virtual bool commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) override; public: SwMailMergeGreetingsPage(SwMailMergeWizard* pWizard, TabPageParent pParent); virtual ~SwMailMergeGreetingsPage() override; - virtual void dispose() override; }; class SwMailBodyDialog : public SfxDialogController, public SwGreetingsHandler diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx index 2738f470821c..bcf40f8b8ea0 100644 --- a/sw/source/ui/dbui/mmlayoutpage.cxx +++ b/sw/source/ui/dbui/mmlayoutpage.cxx @@ -153,16 +153,10 @@ SwMailMergeLayoutPage::SwMailMergeLayoutPage(SwMailMergeWizard* pWizard, TabPage SwMailMergeLayoutPage::~SwMailMergeLayoutPage() { - disposeOnce(); -} - -void SwMailMergeLayoutPage::dispose() -{ File::remove( m_sExampleURL ); - vcl::OWizardPage::dispose(); } -void SwMailMergeLayoutPage::ActivatePage() +void SwMailMergeLayoutPage::Activate() { SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); bool bGreetingLine = rConfigItem.IsGreetingLine(false) && !rConfigItem.IsGreetingInserted(); diff --git a/sw/source/ui/dbui/mmlayoutpage.hxx b/sw/source/ui/dbui/mmlayoutpage.hxx index 6e63992f1b65..5ebff3e1db9a 100644 --- a/sw/source/ui/dbui/mmlayoutpage.hxx +++ b/sw/source/ui/dbui/mmlayoutpage.hxx @@ -70,12 +70,11 @@ class SwMailMergeLayoutPage : public vcl::OWizardPage bool bExample); static void InsertGreeting(SwWrtShell& rShell, SwMailMergeConfigItem const & rConfigItem, bool bExample); - virtual void ActivatePage() override; + virtual void Activate() override; virtual bool commitPage(::vcl::WizardTypes::CommitPageReason _eReason) override; public: SwMailMergeLayoutPage(SwMailMergeWizard* pWizard, TabPageParent pParent); virtual ~SwMailMergeLayoutPage() override; - virtual void dispose() override; static SwFrameFormat* InsertAddressAndGreeting(SwView const * pView, SwMailMergeConfigItem& rConfigItem, diff --git a/sw/source/ui/dialog/docstdlg.cxx b/sw/source/ui/dialog/docstdlg.cxx index 8208b875f13a..5aab6a714cc4 100644 --- a/sw/source/ui/dialog/docstdlg.cxx +++ b/sw/source/ui/dialog/docstdlg.cxx @@ -33,10 +33,11 @@ #include <unotools/localedatawrapper.hxx> #include <vcl/settings.hxx> +#include <vcl/svapp.hxx> -VclPtr<SfxTabPage> SwDocStatPage::Create(TabPageParent pParent, const SfxItemSet *rSet) +std::unique_ptr<SfxTabPage> SwDocStatPage::Create(TabPageParent pParent, const SfxItemSet *rSet) { - return VclPtr<SwDocStatPage>::Create(pParent, *rSet); + return std::make_unique<SwDocStatPage>(pParent, *rSet); } SwDocStatPage::SwDocStatPage(TabPageParent pParent, const SfxItemSet &rSet) @@ -83,7 +84,7 @@ void SwDocStatPage::Reset(const SfxItemSet *) // Description: update / set data void SwDocStatPage::SetData(const SwDocStat &rStat) { - const LocaleDataWrapper& rLocaleData = GetSettings().GetUILocaleDataWrapper(); + const LocaleDataWrapper& rLocaleData = Application::GetSettings().GetUILocaleDataWrapper(); m_xTableNo->set_label(rLocaleData.getNum(rStat.nTable, 0)); m_xGrfNo->set_label(rLocaleData.getNum(rStat.nGrf, 0)); m_xOLENo->set_label(rLocaleData.getNum(rStat.nOLE, 0)); diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index edcb298983db..1099f63c8ac9 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -1513,7 +1513,6 @@ SwInsertSectionTabPage::SwInsertSectionTabPage(TabPageParent pParent, const SfxI SwInsertSectionTabPage::~SwInsertSectionTabPage() { - disposeOnce(); } void SwInsertSectionTabPage::SetWrtShell(SwWrtShell& rSh) @@ -1616,10 +1615,10 @@ void SwInsertSectionTabPage::Reset( const SfxItemSet* ) { } -VclPtr<SfxTabPage> SwInsertSectionTabPage::Create(TabPageParent pParent, +std::unique_ptr<SfxTabPage> SwInsertSectionTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SwInsertSectionTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SwInsertSectionTabPage>(pParent, *rAttrSet); } IMPL_LINK(SwInsertSectionTabPage, ChangeHideHdl, weld::ToggleButton&, rBox, void) @@ -1954,10 +1953,10 @@ void SwSectionFootnoteEndTabPage::Reset( const SfxItemSet* rSet ) ResetState( false, rSet->Get( RES_END_AT_TXTEND, false )); } -VclPtr<SfxTabPage> SwSectionFootnoteEndTabPage::Create( TabPageParent pParent, +std::unique_ptr<SfxTabPage> SwSectionFootnoteEndTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SwSectionFootnoteEndTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SwSectionFootnoteEndTabPage>(pParent, *rAttrSet); } IMPL_LINK( SwSectionFootnoteEndTabPage, FootEndHdl, weld::ToggleButton&, rBox, void ) @@ -2112,9 +2111,9 @@ void SwSectionIndentTabPage::Reset( const SfxItemSet* rSet) IndentModifyHdl(*m_xBeforeMF); } -VclPtr<SfxTabPage> SwSectionIndentTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) +std::unique_ptr<SfxTabPage> SwSectionIndentTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SwSectionIndentTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SwSectionIndentTabPage>(pParent, *rAttrSet); } void SwSectionIndentTabPage::SetWrtShell(SwWrtShell const & rSh) 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; diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx index 37fc878eddc8..e8b959ee3ed3 100644 --- a/sw/source/ui/fldui/flddb.cxx +++ b/sw/source/ui/fldui/flddb.cxx @@ -70,11 +70,6 @@ SwFieldDBPage::SwFieldDBPage(TabPageParent pParent, const SfxItemSet *const pCor SwFieldDBPage::~SwFieldDBPage() { - disposeOnce(); -} - -void SwFieldDBPage::dispose() -{ SwWrtShell* pSh = GetWrtShell(); if (!pSh) pSh = ::GetActiveWrtShell(); @@ -82,8 +77,6 @@ void SwFieldDBPage::dispose() SwDBManager* pDbManager = pSh->GetDoc()->GetDBManager(); if (pDbManager) pDbManager->RevokeLastRegistrations(); - - SwFieldPage::dispose(); } // initialise TabPage @@ -262,10 +255,10 @@ bool SwFieldDBPage::FillItemSet(SfxItemSet* ) return false; } -VclPtr<SfxTabPage> SwFieldDBPage::Create( TabPageParent pParent, +std::unique_ptr<SfxTabPage> SwFieldDBPage::Create( TabPageParent pParent, const SfxItemSet *const pAttrSet ) { - return VclPtr<SwFieldDBPage>::Create( pParent, pAttrSet ); + return std::make_unique<SwFieldDBPage>( pParent, pAttrSet ); } sal_uInt16 SwFieldDBPage::GetGroup() diff --git a/sw/source/ui/fldui/flddb.hxx b/sw/source/ui/fldui/flddb.hxx index e1a8207a7e3e..aac2b5fa31e8 100644 --- a/sw/source/ui/fldui/flddb.hxx +++ b/sw/source/ui/fldui/flddb.hxx @@ -64,9 +64,8 @@ public: SwFieldDBPage(TabPageParent pParent, const SfxItemSet* rSet); virtual ~SwFieldDBPage() override; - virtual void dispose() override; - static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet); + static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet); virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx index bcdbbbfec664..e077868cb552 100644 --- a/sw/source/ui/fldui/flddinf.cxx +++ b/sw/source/ui/fldui/flddinf.cxx @@ -83,7 +83,6 @@ SwFieldDokInfPage::SwFieldDokInfPage(TabPageParent pParent, const SfxItemSet *co SwFieldDokInfPage::~SwFieldDokInfPage() { - disposeOnce(); } void SwFieldDokInfPage::Reset(const SfxItemSet* ) @@ -444,10 +443,10 @@ bool SwFieldDokInfPage::FillItemSet(SfxItemSet* ) return false; } -VclPtr<SfxTabPage> SwFieldDokInfPage::Create( TabPageParent pParent, +std::unique_ptr<SfxTabPage> SwFieldDokInfPage::Create( TabPageParent pParent, const SfxItemSet *const pAttrSet) { - return VclPtr<SwFieldDokInfPage>::Create(pParent, pAttrSet); + return std::make_unique<SwFieldDokInfPage>(pParent, pAttrSet); } sal_uInt16 SwFieldDokInfPage::GetGroup() diff --git a/sw/source/ui/fldui/flddinf.hxx b/sw/source/ui/fldui/flddinf.hxx index ed36cf581811..15c09d9084c5 100644 --- a/sw/source/ui/fldui/flddinf.hxx +++ b/sw/source/ui/fldui/flddinf.hxx @@ -55,7 +55,7 @@ public: SwFieldDokInfPage(TabPageParent pWindow, const SfxItemSet* pSet); virtual ~SwFieldDokInfPage() override; - static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet); + static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet); virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx index 6d6b9ff7e98c..d1d04e96457b 100644 --- a/sw/source/ui/fldui/flddok.cxx +++ b/sw/source/ui/fldui/flddok.cxx @@ -74,7 +74,6 @@ SwFieldDokPage::SwFieldDokPage(TabPageParent pParent, const SfxItemSet *const pC SwFieldDokPage::~SwFieldDokPage() { - disposeOnce(); } void SwFieldDokPage::Reset(const SfxItemSet* ) @@ -609,10 +608,10 @@ bool SwFieldDokPage::FillItemSet(SfxItemSet* ) return false; } -VclPtr<SfxTabPage> SwFieldDokPage::Create(TabPageParent pParent, +std::unique_ptr<SfxTabPage> SwFieldDokPage::Create(TabPageParent pParent, const SfxItemSet *const pAttrSet) { - return VclPtr<SwFieldDokPage>::Create(pParent, pAttrSet); + return std::make_unique<SwFieldDokPage>(pParent, pAttrSet); } sal_uInt16 SwFieldDokPage::GetGroup() diff --git a/sw/source/ui/fldui/flddok.hxx b/sw/source/ui/fldui/flddok.hxx index 4ed50de52a38..2fd437d7e4b9 100644 --- a/sw/source/ui/fldui/flddok.hxx +++ b/sw/source/ui/fldui/flddok.hxx @@ -59,7 +59,7 @@ public: virtual ~SwFieldDokPage() override; - static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet); + static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet); virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx index 84074dd4b45a..8cd8577920d9 100644 --- a/sw/source/ui/fldui/fldedt.cxx +++ b/sw/source/ui/fldui/fldedt.cxx @@ -135,9 +135,8 @@ SwFieldEditDlg::SwFieldEditDlg(SwView const & rVw) // initialise controls void SwFieldEditDlg::Init() { - VclPtr<SwFieldPage> pTabPage = static_cast<SwFieldPage*>(GetTabPage()); - - if( pTabPage ) + SwFieldPage* pTabPage = static_cast<SwFieldPage*>(GetTabPage()); + if (pTabPage) { SwFieldMgr& rMgr = pTabPage->GetFieldMgr(); @@ -174,23 +173,23 @@ void SwFieldEditDlg::Init() !pSh->HasReadonlySel()); } -VclPtr<SfxTabPage> SwFieldEditDlg::CreatePage(sal_uInt16 nGroup) +SfxTabPage* SwFieldEditDlg::CreatePage(sal_uInt16 nGroup) { TabPageParent pPageParent(get_content_area(), this); // create TabPage - VclPtr<SfxTabPage> pTabPage; + std::unique_ptr<SfxTabPage> xTabPage; switch (nGroup) { case GRP_DOC: - pTabPage = SwFieldDokPage::Create(pPageParent, nullptr); + xTabPage = SwFieldDokPage::Create(pPageParent, nullptr); break; case GRP_FKT: - pTabPage = SwFieldFuncPage::Create(pPageParent, nullptr); + xTabPage = SwFieldFuncPage::Create(pPageParent, nullptr); break; case GRP_REF: - pTabPage = SwFieldRefPage::Create(pPageParent, nullptr); + xTabPage = SwFieldRefPage::Create(pPageParent, nullptr); break; case GRP_REG: { @@ -205,30 +204,27 @@ VclPtr<SfxTabPage> SwFieldEditDlg::CreatePage(sal_uInt16 nGroup) xDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW); pSet->Put( SfxUnoAnyItem( SID_DOCINFO, uno::makeAny(xUDProps) ) ); - pTabPage = SwFieldDokInfPage::Create(pPageParent, pSet); + xTabPage = SwFieldDokInfPage::Create(pPageParent, pSet); break; } #if HAVE_FEATURE_DBCONNECTIVITY case GRP_DB: - pTabPage = SwFieldDBPage::Create(pPageParent, nullptr); - static_cast<SwFieldDBPage*>(pTabPage.get())->SetWrtShell(*pSh); + xTabPage = SwFieldDBPage::Create(pPageParent, nullptr); + static_cast<SwFieldDBPage*>(xTabPage.get())->SetWrtShell(*pSh); break; #endif case GRP_VAR: - pTabPage = SwFieldVarPage::Create(pPageParent, nullptr); + xTabPage = SwFieldVarPage::Create(pPageParent, nullptr); break; } - assert(pTabPage); + assert(xTabPage); - if (pTabPage) - { - static_cast<SwFieldPage*>(pTabPage.get())->SetWrtShell(pSh); - SetTabPage(pTabPage); - } + static_cast<SwFieldPage*>(xTabPage.get())->SetWrtShell(pSh); + SetTabPage(std::move(xTabPage)); - return pTabPage; + return GetTabPage(); } SwFieldEditDlg::~SwFieldEditDlg() @@ -254,7 +250,7 @@ IMPL_LINK_NOARG(SwFieldEditDlg, OKHdl, weld::Button&, void) { if (GetOKButton().get_sensitive()) { - VclPtr<SfxTabPage> pTabPage = GetTabPage(); + SfxTabPage* pTabPage = GetTabPage(); if (pTabPage) pTabPage->FillItemSet(nullptr); m_xDialog->response(RET_OK); @@ -275,7 +271,7 @@ IMPL_LINK(SwFieldEditDlg, NextPrevHdl, weld::Button&, rButton, void) pSh->EnterStdMode(); SwFieldType *pOldTyp = nullptr; - VclPtr<SwFieldPage> pTabPage = static_cast<SwFieldPage*>(GetTabPage()); + SwFieldPage* pTabPage = static_cast<SwFieldPage*>(GetTabPage()); //#112462# FillItemSet may delete the current field //that's why it has to be called before accessing the current field @@ -295,7 +291,7 @@ IMPL_LINK(SwFieldEditDlg, NextPrevHdl, weld::Button&, rButton, void) sal_uInt16 nGroup = SwFieldMgr::GetGroup(pCurField->GetTypeId(), pCurField->GetSubType()); if (nGroup != pTabPage->GetGroup()) - pTabPage = static_cast<SwFieldPage*>(CreatePage(nGroup).get()); + pTabPage = static_cast<SwFieldPage*>(CreatePage(nGroup)); pTabPage->EditNewField(); diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx index 01612125b427..f140b30dd201 100644 --- a/sw/source/ui/fldui/fldfunc.cxx +++ b/sw/source/ui/fldui/fldfunc.cxx @@ -89,7 +89,6 @@ SwFieldFuncPage::SwFieldFuncPage(TabPageParent pParent, const SfxItemSet *const SwFieldFuncPage::~SwFieldFuncPage() { - disposeOnce(); } void SwFieldFuncPage::Reset(const SfxItemSet* ) @@ -576,10 +575,10 @@ bool SwFieldFuncPage::FillItemSet(SfxItemSet* ) return false; } -VclPtr<SfxTabPage> SwFieldFuncPage::Create( TabPageParent pParent, +std::unique_ptr<SfxTabPage> SwFieldFuncPage::Create( TabPageParent pParent, const SfxItemSet *const pAttrSet) { - return VclPtr<SwFieldFuncPage>::Create( pParent, pAttrSet ); + return std::make_unique<SwFieldFuncPage>(pParent, pAttrSet); } sal_uInt16 SwFieldFuncPage::GetGroup() diff --git a/sw/source/ui/fldui/fldfunc.hxx b/sw/source/ui/fldui/fldfunc.hxx index 24a1264ef7b6..78588ad65cb4 100644 --- a/sw/source/ui/fldui/fldfunc.hxx +++ b/sw/source/ui/fldui/fldfunc.hxx @@ -82,7 +82,7 @@ public: SwFieldFuncPage(TabPageParent pParent, const SfxItemSet* pSet); virtual ~SwFieldFuncPage() override; - static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet); + static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet); virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx index b200528674a5..ba7673cf367d 100644 --- a/sw/source/ui/fldui/fldpage.cxx +++ b/sw/source/ui/fldui/fldpage.cxx @@ -97,7 +97,7 @@ void SwFieldPage::Init() } // newly initialise page -void SwFieldPage::ActivatePage() +void SwFieldPage::Activate() { EnableInsert(m_bInsert); } diff --git a/sw/source/ui/fldui/fldpage.hxx b/sw/source/ui/fldui/fldpage.hxx index 5fd94297244a..98cfd6760be9 100644 --- a/sw/source/ui/fldui/fldpage.hxx +++ b/sw/source/ui/fldui/fldpage.hxx @@ -70,15 +70,13 @@ protected: sal_Unicode cDelim = ' ', bool bIsAutomaticLanguage = true); - using SfxTabPage::ActivatePage; - public: SwFieldPage(TabPageParent pParent, const OUString& rUIXMLDescription, const OString& rID, const SfxItemSet *pAttrSet); virtual ~SwFieldPage() override; - virtual void ActivatePage() override; + virtual void Activate() override; SwFieldMgr& GetFieldMgr() { return m_aMgr; } void SetWrtShell( SwWrtShell* m_pWrtShell ); diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx index dc5d36977044..e41c9d7c1599 100644 --- a/sw/source/ui/fldui/fldref.cxx +++ b/sw/source/ui/fldui/fldref.cxx @@ -110,7 +110,6 @@ SwFieldRefPage::SwFieldRefPage(TabPageParent pParent, const SfxItemSet *const pC SwFieldRefPage::~SwFieldRefPage() { - disposeOnce(); } IMPL_LINK_NOARG(SwFieldRefPage, ModifyHdl_Impl, weld::Entry&, void) @@ -1085,10 +1084,10 @@ bool SwFieldRefPage::FillItemSet(SfxItemSet* ) return false; } -VclPtr<SfxTabPage> SwFieldRefPage::Create( TabPageParent pParent, +std::unique_ptr<SfxTabPage> SwFieldRefPage::Create( TabPageParent pParent, const SfxItemSet *const pAttrSet) { - return VclPtr<SwFieldRefPage>::Create( pParent, pAttrSet ); + return std::make_unique<SwFieldRefPage>(pParent, pAttrSet); } sal_uInt16 SwFieldRefPage::GetGroup() diff --git a/sw/source/ui/fldui/fldref.hxx b/sw/source/ui/fldui/fldref.hxx index 9add08a354a1..d578e109ac87 100644 --- a/sw/source/ui/fldui/fldref.hxx +++ b/sw/source/ui/fldui/fldref.hxx @@ -80,7 +80,7 @@ public: SwFieldRefPage(TabPageParent pParent, const SfxItemSet* pSet); virtual ~SwFieldRefPage() override; - static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet); + static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet); virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx index e2431cff384c..b5aa075a6544 100644 --- a/sw/source/ui/fldui/fldvar.cxx +++ b/sw/source/ui/fldui/fldvar.cxx @@ -84,7 +84,6 @@ SwFieldVarPage::SwFieldVarPage(TabPageParent pParent, const SfxItemSet *const pC SwFieldVarPage::~SwFieldVarPage() { - disposeOnce(); } void SwFieldVarPage::Reset(const SfxItemSet* ) @@ -1204,10 +1203,10 @@ bool SwFieldVarPage::FillItemSet(SfxItemSet* ) return false; } -VclPtr<SfxTabPage> SwFieldVarPage::Create( TabPageParent pParent, +std::unique_ptr<SfxTabPage> SwFieldVarPage::Create( TabPageParent pParent, const SfxItemSet *const pAttrSet) { - return VclPtr<SwFieldVarPage>::Create( pParent, pAttrSet ); + return std::make_unique<SwFieldVarPage>( pParent, pAttrSet ); } sal_uInt16 SwFieldVarPage::GetGroup() diff --git a/sw/source/ui/fldui/fldvar.hxx b/sw/source/ui/fldui/fldvar.hxx index 245f575db77d..d47d3f819da8 100644 --- a/sw/source/ui/fldui/fldvar.hxx +++ b/sw/source/ui/fldui/fldvar.hxx @@ -70,11 +70,9 @@ protected: public: SwFieldVarPage(TabPageParent pParent, const SfxItemSet* pSet); - + static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet); virtual ~SwFieldVarPage() override; - static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet); - virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index 769bf2d9fcc9..6e27d1d7dcd1 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -167,9 +167,9 @@ SwColumnDlg::SwColumnDlg(weld::Window* pParent, SwWrtShell& rSh) assert(pColPgSet); // create TabPage - m_pTabPage = static_cast<SwColumnPage*>(SwColumnPage::Create(TabPageParent(m_xContentArea.get(), this), pColPgSet).get()); - m_pTabPage->GetApplyLabel()->show(); - weld::ComboBox* pApplyToLB = m_pTabPage->GetApplyComboBox(); + m_xTabPage = std::make_unique<SwColumnPage>(TabPageParent(m_xContentArea.get(), this), *pColPgSet); + m_xTabPage->GetApplyLabel()->show(); + weld::ComboBox* pApplyToLB = m_xTabPage->GetApplyComboBox(); pApplyToLB->show(); if (pCurrSection && (!m_rWrtShell.HasSelection() || 0 != nFullSectCnt)) @@ -210,13 +210,12 @@ SwColumnDlg::SwColumnDlg(weld::Window* pParent, SwWrtShell& rSh) if (!pApplyToLB->get_count()) m_xOkButton->set_sensitive(false); //#i97810# set focus to the TabPage - m_pTabPage->ActivateColumnControl(); - m_pTabPage->Show(); + m_xTabPage->ActivateColumnControl(); } SwColumnDlg::~SwColumnDlg() { - m_pTabPage.disposeAndClear(); + m_xTabPage.reset(); } IMPL_LINK(SwColumnDlg, ObjectListBoxHdl, weld::ComboBox&, rBox, void) @@ -230,9 +229,9 @@ void SwColumnDlg::ObjectHdl(const weld::ComboBox* pBox) if (pBox) { - m_pTabPage->FillItemSet(pSet); + m_xTabPage->FillItemSet(pSet); } - weld::ComboBox* pApplyToLB = m_pTabPage->GetApplyComboBox(); + weld::ComboBox* pApplyToLB = m_xTabPage->GetApplyComboBox(); m_nOldSelection = pApplyToLB->get_active_id().toInt32(); long nWidth = m_nSelectionWidth; switch(m_nOldSelection) @@ -258,19 +257,19 @@ void SwColumnDlg::ObjectHdl(const weld::ComboBox* pBox) } bool bIsSection = pSet == m_pSectionSet.get() || pSet == m_pSelectionSet.get(); - m_pTabPage->ShowBalance(bIsSection); - m_pTabPage->SetInSection(bIsSection); - m_pTabPage->SetFrameMode(true); - m_pTabPage->SetPageWidth(nWidth); + m_xTabPage->ShowBalance(bIsSection); + m_xTabPage->SetInSection(bIsSection); + m_xTabPage->SetFrameMode(true); + m_xTabPage->SetPageWidth(nWidth); if( pSet ) - m_pTabPage->Reset(pSet); + m_xTabPage->Reset(pSet); } IMPL_LINK_NOARG(SwColumnDlg, OkHdl, weld::Button&, void) { // evaluate current selection SfxItemSet* pSet = EvalCurrentSelection(); - m_pTabPage->FillItemSet(pSet); + m_xTabPage->FillItemSet(pSet); if(m_pSelectionSet && SfxItemState::SET == m_pSelectionSet->GetItemState(RES_COL)) { @@ -511,11 +510,6 @@ SwColumnPage::SwColumnPage(TabPageParent pParent, const SfxItemSet &rSet) SwColumnPage::~SwColumnPage() { - disposeOnce(); -} - -void SwColumnPage::dispose() -{ m_xFrameExampleWN.reset(); m_xPgeExampleWN.reset(); m_xDefaultVS.reset(); @@ -527,7 +521,6 @@ void SwColumnPage::dispose() m_xLineTypeDLB.reset(); m_xLineColorDLB.reset(); m_xTextDirectionLB.reset(); - SfxTabPage::dispose(); } void SwColumnPage::SetPageWidth(long nPageWidth) @@ -605,9 +598,9 @@ void SwColumnPage::Reset(const SfxItemSet *rSet) } // create TabPage -VclPtr<SfxTabPage> SwColumnPage::Create(TabPageParent pParent, const SfxItemSet *rSet) +std::unique_ptr<SfxTabPage> SwColumnPage::Create(TabPageParent pParent, const SfxItemSet *rSet) { - return VclPtr<SwColumnPage>::Create(pParent, *rSet); + return std::make_unique<SwColumnPage>(pParent, *rSet); } // stuff attributes into the Set when OK diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index c721285499c3..9add39674904 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -717,7 +717,6 @@ SwFramePage::SwFramePage(TabPageParent pParent, const SfxItemSet &rSet) SwFramePage::~SwFramePage() { - disposeOnce(); } namespace @@ -821,9 +820,9 @@ void SwFramePage::setOptimalRelWidth() m_xHoriRelationLB->clear(); } -VclPtr<SfxTabPage> SwFramePage::Create(TabPageParent pParent, const SfxItemSet *rSet) +std::unique_ptr<SfxTabPage> SwFramePage::Create(TabPageParent pParent, const SfxItemSet *rSet) { - return VclPtr<SwFramePage>::Create(pParent, *rSet); + return std::make_unique<SwFramePage>(pParent, *rSet); } void SwFramePage::EnableGraficMode() @@ -911,9 +910,9 @@ void SwFramePage::Reset( const SfxItemSet *rSet ) else { if ( m_bNew ) - SetText(SwResId(STR_FRMUI_OLE_INSERT)); + SetPageTitle(SwResId(STR_FRMUI_OLE_INSERT)); else - SetText(SwResId(STR_FRMUI_OLE_EDIT)); + SetPageTitle(SwResId(STR_FRMUI_OLE_EDIT)); } } else @@ -2319,20 +2318,14 @@ SwGrfExtPage::SwGrfExtPage(TabPageParent pParent, const SfxItemSet &rSet) SwGrfExtPage::~SwGrfExtPage() { - disposeOnce(); -} - -void SwGrfExtPage::dispose() -{ m_xBmpWin.reset(); m_xCtlAngle.reset(); m_xGrfDlg.reset(); - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> SwGrfExtPage::Create(TabPageParent pParent, const SfxItemSet *rSet) +std::unique_ptr<SfxTabPage> SwGrfExtPage::Create(TabPageParent pParent, const SfxItemSet *rSet) { - return VclPtr<SwGrfExtPage>::Create(pParent, *rSet); + return std::make_unique<SwGrfExtPage>(pParent, *rSet); } void SwGrfExtPage::Reset(const SfxItemSet *rSet) @@ -2679,7 +2672,6 @@ SwFrameURLPage::SwFrameURLPage(TabPageParent pParent, const SfxItemSet &rSet) SwFrameURLPage::~SwFrameURLPage() { - disposeOnce(); } void SwFrameURLPage::Reset( const SfxItemSet *rSet ) @@ -2755,15 +2747,15 @@ bool SwFrameURLPage::FillItemSet(SfxItemSet *rSet) return bModified; } -VclPtr<SfxTabPage> SwFrameURLPage::Create(TabPageParent pParent, const SfxItemSet *rSet) +std::unique_ptr<SfxTabPage> SwFrameURLPage::Create(TabPageParent pParent, const SfxItemSet *rSet) { - return VclPtr<SwFrameURLPage>::Create(pParent, *rSet); + return std::make_unique<SwFrameURLPage>(pParent, *rSet); } IMPL_LINK_NOARG(SwFrameURLPage, InsertFileHdl, weld::Button&, void) { FileDialogHelper aDlgHelper(ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, - FileDialogFlags::NONE, GetFrameWeld()); + FileDialogFlags::NONE, GetDialogFrameWeld()); uno::Reference < ui::dialogs::XFilePicker3 > xFP = aDlgHelper.GetFilePicker(); try @@ -2819,18 +2811,12 @@ SwFrameAddPage::SwFrameAddPage(TabPageParent pParent, const SfxItemSet &rSet) SwFrameAddPage::~SwFrameAddPage() { - disposeOnce(); -} - -void SwFrameAddPage::dispose() -{ m_xTextFlowLB.reset(); - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> SwFrameAddPage::Create(TabPageParent pParent, const SfxItemSet *rSet) +std::unique_ptr<SfxTabPage> SwFrameAddPage::Create(TabPageParent pParent, const SfxItemSet *rSet) { - return VclPtr<SwFrameAddPage>::Create(pParent, *rSet); + return std::make_unique<SwFrameAddPage>(pParent, *rSet); } void SwFrameAddPage::Reset(const SfxItemSet *rSet ) diff --git a/sw/source/ui/frmdlg/uiborder.cxx b/sw/source/ui/frmdlg/uiborder.cxx index 9db98fd2e483..06d99bb2a78d 100644 --- a/sw/source/ui/frmdlg/uiborder.cxx +++ b/sw/source/ui/frmdlg/uiborder.cxx @@ -40,13 +40,13 @@ SwBorderDlg::SwBorderDlg(weld::Window* pParent, SfxItemSet& rSet, SwBorderModes if (fnCreatePage) { TabPageParent pPageParent(get_content_area(), this); - VclPtr<SfxTabPage> xNewPage = (*fnCreatePage)(pPageParent, &rSet); + std::unique_ptr<SfxTabPage> xNewPage = (*fnCreatePage)(pPageParent, &rSet); SfxAllItemSet aSet(*(rSet.GetPool())); aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE, static_cast<sal_uInt16>(nType))); if(SwBorderModes::TABLE == nType) aSet.Put (SfxUInt32Item(SID_FLAG_TYPE,SVX_HIDESHADOWCTL)); xNewPage->PageCreated(aSet); - SetTabPage(xNewPage); + SetTabPage(std::move(xNewPage)); } } diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx index 99d9ad75e1b4..3b3f5909768a 100644 --- a/sw/source/ui/frmdlg/wrap.cxx +++ b/sw/source/ui/frmdlg/wrap.cxx @@ -59,10 +59,11 @@ SwWrapDlg::SwWrapDlg(weld::Window* pParent, SfxItemSet& rSet, SwWrtShell* pWrtSh { // create TabPage TabPageParent pPageParent(get_content_area(), this); - VclPtr<SwWrapTabPage> xNewPage = static_cast<SwWrapTabPage*>(SwWrapTabPage::Create(pPageParent, &rSet).get()); - xNewPage->SetFormatUsed(false, bDrawMode); - xNewPage->SetShell(pWrtShell); - SetTabPage(xNewPage); + auto xNewPage = SwWrapTabPage::Create(pPageParent, &rSet); + SwWrapTabPage* pWrapPage = static_cast<SwWrapTabPage*>(xNewPage.get()); + pWrapPage->SetFormatUsed(false, bDrawMode); + pWrapPage->SetShell(pWrtShell); + SetTabPage(std::move(xNewPage)); } SwWrapTabPage::SwWrapTabPage(TabPageParent pParent, const SfxItemSet &rSet) @@ -114,9 +115,9 @@ SwWrapTabPage::~SwWrapTabPage() { } -VclPtr<SfxTabPage> SwWrapTabPage::Create(TabPageParent pParent, const SfxItemSet *rSet) +std::unique_ptr<SfxTabPage> SwWrapTabPage::Create(TabPageParent pParent, const SfxItemSet *rSet) { - return VclPtr<SwWrapTabPage>::Create(pParent, *rSet); + return std::make_unique<SwWrapTabPage>(pParent, *rSet); } void SwWrapTabPage::Reset(const SfxItemSet *rSet) diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index d8527538469b..a23cf50987b2 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -808,15 +808,9 @@ SwTOXSelectTabPage::SwTOXSelectTabPage(TabPageParent pParent, const SfxItemSet& SwTOXSelectTabPage::~SwTOXSelectTabPage() { - disposeOnce(); -} - -void SwTOXSelectTabPage::dispose() -{ pIndexRes.reset(); pIndexEntryWrapper.reset(); m_xLanguageLB.reset(); - SfxTabPage::dispose(); } void SwTOXSelectTabPage::SetWrtShell(SwWrtShell const & rSh) @@ -1179,9 +1173,9 @@ DeactivateRC SwTOXSelectTabPage::DeactivatePage(SfxItemSet* _pSet) return DeactivateRC::LeavePage; } -VclPtr<SfxTabPage> SwTOXSelectTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) +std::unique_ptr<SfxTabPage> SwTOXSelectTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SwTOXSelectTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SwTOXSelectTabPage>(pParent, *rAttrSet); } IMPL_LINK(SwTOXSelectTabPage, TOXTypeHdl, weld::ComboBox&, rBox, void) @@ -1915,13 +1909,7 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(TabPageParent pParent, const SfxItemSet& rA SwTOXEntryTabPage::~SwTOXEntryTabPage() { - disposeOnce(); -} - -void SwTOXEntryTabPage::dispose() -{ m_xTokenWIN.reset(); - SfxTabPage::dispose(); } IMPL_LINK_NOARG(SwTOXEntryTabPage, ModifyClickHdl, weld::ToggleButton&, void) @@ -2124,9 +2112,9 @@ DeactivateRC SwTOXEntryTabPage::DeactivatePage( SfxItemSet* /*pSet*/) return DeactivateRC::LeavePage; } -VclPtr<SfxTabPage> SwTOXEntryTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) +std::unique_ptr<SfxTabPage> SwTOXEntryTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SwTOXEntryTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SwTOXEntryTabPage>(pParent, *rAttrSet); } IMPL_LINK_NOARG(SwTOXEntryTabPage, EditStyleHdl, weld::Button&, void) @@ -3471,10 +3459,10 @@ DeactivateRC SwTOXStylesTabPage::DeactivatePage( SfxItemSet* /*pSet*/ ) return DeactivateRC::LeavePage; } -VclPtr<SfxTabPage> SwTOXStylesTabPage::Create(TabPageParent pParent, +std::unique_ptr<SfxTabPage> SwTOXStylesTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SwTOXStylesTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SwTOXStylesTabPage>(pParent, *rAttrSet); } IMPL_LINK_NOARG(SwTOXStylesTabPage, EditStyleHdl, weld::Button&, void) diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx index c8512fac27f2..081ad7fb7f03 100644 --- a/sw/source/ui/misc/docfnote.cxx +++ b/sw/source/ui/misc/docfnote.cxx @@ -105,7 +105,6 @@ SwEndNoteOptionPage::SwEndNoteOptionPage(TabPageParent pParent, bool bEN, SwEndNoteOptionPage::~SwEndNoteOptionPage() { - disposeOnce(); } void SwEndNoteOptionPage::Reset( const SfxItemSet* ) @@ -210,9 +209,9 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet* ) m_xPageTemplBox->set_active_text(pInf->GetPageDesc(*pSh->GetDoc())->GetName()); } -VclPtr<SfxTabPage> SwEndNoteOptionPage::Create( TabPageParent pParent, const SfxItemSet *rSet ) +std::unique_ptr<SfxTabPage> SwEndNoteOptionPage::Create( TabPageParent pParent, const SfxItemSet *rSet ) { - return VclPtr<SwEndNoteOptionPage>::Create(pParent, true, *rSet); + return std::make_unique<SwEndNoteOptionPage>(pParent, true, *rSet); } // Different kinds of numbering; because the Listbox has varying numbers of @@ -379,9 +378,9 @@ SwFootNoteOptionPage::~SwFootNoteOptionPage() { } -VclPtr<SfxTabPage> SwFootNoteOptionPage::Create(TabPageParent pParent, const SfxItemSet *rSet ) +std::unique_ptr<SfxTabPage> SwFootNoteOptionPage::Create(TabPageParent pParent, const SfxItemSet *rSet ) { - return VclPtr<SwFootNoteOptionPage>::Create(pParent, *rSet); + return std::make_unique<SwFootNoteOptionPage>(pParent, *rSet); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/misc/impfnote.hxx b/sw/source/ui/misc/impfnote.hxx index fba53a2e0c5c..fb02e5732773 100644 --- a/sw/source/ui/misc/impfnote.hxx +++ b/sw/source/ui/misc/impfnote.hxx @@ -64,7 +64,7 @@ public: SwEndNoteOptionPage(TabPageParent pParent, bool bEndNote, const SfxItemSet &rSet); virtual ~SwEndNoteOptionPage() override; - static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet); + static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet); virtual bool FillItemSet(SfxItemSet *rSet) override; virtual void Reset( const SfxItemSet* ) override; @@ -73,12 +73,10 @@ public: class SwFootNoteOptionPage : public SwEndNoteOptionPage { - friend class VclPtr<SwFootNoteOptionPage>; +public: SwFootNoteOptionPage(TabPageParent pParent, const SfxItemSet &rSet ); + static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet); virtual ~SwFootNoteOptionPage() override; - -public: - static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet); }; #endif diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx index 20c74684f54b..a11e639f3797 100644 --- a/sw/source/ui/misc/num.cxx +++ b/sw/source/ui/misc/num.cxx @@ -136,14 +136,8 @@ SwNumPositionTabPage::SwNumPositionTabPage(TabPageParent pParent, const SfxItemS SwNumPositionTabPage::~SwNumPositionTabPage() { - disposeOnce(); -} - -void SwNumPositionTabPage::dispose() -{ pActNum.reset(); pOutlineDlg = nullptr; - SfxTabPage::dispose(); } void SwNumPositionTabPage::InitControls() @@ -497,10 +491,10 @@ void SwNumPositionTabPage::ShowControlsDependingOnPosAndSpaceMode() m_xIndentAtMF->set_visible( bLabelAlignmentPosAndSpaceModeActive ); } -VclPtr<SfxTabPage> SwNumPositionTabPage::Create( TabPageParent pParent, +std::unique_ptr<SfxTabPage> SwNumPositionTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SwNumPositionTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SwNumPositionTabPage>(pParent, *rAttrSet); } void SwNumPositionTabPage::SetWrtShell(SwWrtShell* pSh) diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index b7b760a8222e..88353b9025a3 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -801,10 +801,10 @@ void SwOutlineSettingsTabPage::Reset( const SfxItemSet* rSet ) ActivatePage(*rSet); } -VclPtr<SfxTabPage> SwOutlineSettingsTabPage::Create(TabPageParent pParent, +std::unique_ptr<SfxTabPage> SwOutlineSettingsTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SwOutlineSettingsTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SwOutlineSettingsTabPage>(pParent, *rAttrSet); } void SwOutlineSettingsTabPage::CheckForStartValue_Impl(sal_uInt16 nNumberingType) diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx index 0a93846d03d3..e4004b3c3ae4 100644 --- a/sw/source/ui/misc/pgfnote.cxx +++ b/sw/source/ui/misc/pgfnote.cxx @@ -131,19 +131,13 @@ SwFootNotePage::SwFootNotePage(TabPageParent pParent, const SfxItemSet &rSet) SwFootNotePage::~SwFootNotePage() { - disposeOnce(); -} - -void SwFootNotePage::dispose() -{ m_xLineColorBox.reset(); m_xLineTypeBox.reset(); - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> SwFootNotePage::Create(TabPageParent pParent, const SfxItemSet *rSet) +std::unique_ptr<SfxTabPage> SwFootNotePage::Create(TabPageParent pParent, const SfxItemSet *rSet) { - return VclPtr<SwFootNotePage>::Create(pParent, *rSet); + return std::make_unique<SwFootNotePage>(pParent, *rSet); } void SwFootNotePage::Reset(const SfxItemSet *rSet) diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx index 860f913985cd..334550268531 100644 --- a/sw/source/ui/misc/pggrid.cxx +++ b/sw/source/ui/misc/pggrid.cxx @@ -126,18 +126,12 @@ SwTextGridPage::SwTextGridPage(TabPageParent pParent, const SfxItemSet &rSet) SwTextGridPage::~SwTextGridPage() { - disposeOnce(); -} - -void SwTextGridPage::dispose() -{ m_xColorLB.reset(); - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> SwTextGridPage::Create(TabPageParent pParent, const SfxItemSet *rSet) +std::unique_ptr<SfxTabPage> SwTextGridPage::Create(TabPageParent pParent, const SfxItemSet *rSet) { - return VclPtr<SwTextGridPage>::Create(pParent, *rSet); + return std::make_unique<SwTextGridPage>(pParent, *rSet); } bool SwTextGridPage::FillItemSet(SfxItemSet *rSet) diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx index 1871d74a4f9e..a990769bde37 100644 --- a/sw/source/ui/table/tabledlg.cxx +++ b/sw/source/ui/table/tabledlg.cxx @@ -366,9 +366,9 @@ void SwFormatTablePage::ModifyHdl(const weld::MetricSpinButton& rEdit) bModified = true; } -VclPtr<SfxTabPage> SwFormatTablePage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) +std::unique_ptr<SfxTabPage> SwFormatTablePage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SwFormatTablePage>::Create(pParent, *rAttrSet); + return std::make_unique<SwFormatTablePage>(pParent, *rAttrSet); } bool SwFormatTablePage::FillItemSet( SfxItemSet* rCoreSet ) @@ -767,22 +767,16 @@ IMPL_LINK_NOARG(SwTableColumnPage, SizeHdl, void*, void) SwTableColumnPage::~SwTableColumnPage() { - disposeOnce(); -} - -void SwTableColumnPage::dispose() -{ if (m_pSizeHdlEvent) { Application::RemoveUserEvent(m_pSizeHdlEvent); m_pSizeHdlEvent = nullptr; } - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> SwTableColumnPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) +std::unique_ptr<SfxTabPage> SwTableColumnPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SwTableColumnPage>::Create(pParent, *rAttrSet); + return std::make_unique<SwTableColumnPage>(pParent, *rAttrSet); } void SwTableColumnPage::Reset( const SfxItemSet* ) @@ -1286,10 +1280,10 @@ SwTextFlowPage::~SwTextFlowPage() { } -VclPtr<SfxTabPage> SwTextFlowPage::Create( TabPageParent pParent, - const SfxItemSet* rAttrSet) +std::unique_ptr<SfxTabPage> SwTextFlowPage::Create(TabPageParent pParent, + const SfxItemSet* rAttrSet) { - return VclPtr<SwTextFlowPage>::Create(pParent, *rAttrSet); + return std::make_unique<SwTextFlowPage>(pParent, *rAttrSet); } bool SwTextFlowPage::FillItemSet( SfxItemSet* rSet ) |