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 /cui | |
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 'cui')
115 files changed, 425 insertions, 1016 deletions
diff --git a/cui/source/customize/SvxMenuConfigPage.cxx b/cui/source/customize/SvxMenuConfigPage.cxx index d68582f7da5f..08fb276030be 100644 --- a/cui/source/customize/SvxMenuConfigPage.cxx +++ b/cui/source/customize/SvxMenuConfigPage.cxx @@ -134,7 +134,9 @@ IMPL_LINK(SvxMenuConfigPage, MenuEntriesSizeAllocHdl, const Size&, rSize, void) SvxMenuConfigPage::~SvxMenuConfigPage() { - disposeOnce(); + for (int i = 0, nCount = m_xSaveInListBox->get_count(); i < nCount; ++i) + delete reinterpret_cast<SaveInData*>(m_xSaveInListBox->get_id(i).toInt64()); + m_xSaveInListBox->clear(); } // Populates the Menu combo box @@ -156,15 +158,6 @@ void SvxMenuConfigPage::Init() m_xCommandCategoryListBox->categorySelected(m_xFunctions.get(), OUString(), GetSaveInData()); } -void SvxMenuConfigPage::dispose() -{ - for (int i = 0, nCount = m_xSaveInListBox->get_count(); i < nCount; ++i) - delete reinterpret_cast<SaveInData*>(m_xSaveInListBox->get_id(i).toInt64()); - m_xSaveInListBox->clear(); - - SvxConfigPage::dispose(); -} - IMPL_LINK_NOARG(SvxMenuConfigPage, SelectMenuEntry, weld::TreeView&, void) { UpdateButtonStates(); diff --git a/cui/source/customize/SvxNotebookbarConfigPage.cxx b/cui/source/customize/SvxNotebookbarConfigPage.cxx index 521aafcfa67e..5c439ab8182b 100644 --- a/cui/source/customize/SvxNotebookbarConfigPage.cxx +++ b/cui/source/customize/SvxNotebookbarConfigPage.cxx @@ -152,7 +152,7 @@ SvxNotebookbarConfigPage::SvxNotebookbarConfigPage(TabPageParent pParent, const rTreeView.show(); } -SvxNotebookbarConfigPage::~SvxNotebookbarConfigPage() { disposeOnce(); } +SvxNotebookbarConfigPage::~SvxNotebookbarConfigPage() {} void SvxNotebookbarConfigPage::DeleteSelectedTopLevel() {} diff --git a/cui/source/customize/SvxToolbarConfigPage.cxx b/cui/source/customize/SvxToolbarConfigPage.cxx index ff63843fb261..39de9ba9f08d 100644 --- a/cui/source/customize/SvxToolbarConfigPage.cxx +++ b/cui/source/customize/SvxToolbarConfigPage.cxx @@ -156,11 +156,6 @@ IMPL_LINK_NOARG(SvxToolbarConfigPage, ListModifiedHdl, weld::TreeView&, void) SvxToolbarConfigPage::~SvxToolbarConfigPage() { - disposeOnce(); -} - -void SvxToolbarConfigPage::dispose() -{ for (int i = 0, nCount = m_xSaveInListBox->get_count(); i < nCount; ++i) { ToolbarSaveInData* pData = @@ -168,8 +163,6 @@ void SvxToolbarConfigPage::dispose() delete pData; } m_xSaveInListBox->clear(); - - SvxConfigPage::dispose(); } void SvxToolbarConfigPage::DeleteSelectedTopLevel() @@ -860,10 +853,10 @@ void SvxToolbarEntriesListBox::ChangedVisibility(int nRow) { pEntryData->SetVisible(m_xControl->get_toggle(nRow, 0) == TRISTATE_TRUE); - SvxConfigEntry* pToolbar = pPage->GetTopLevelSelection(); + SvxConfigEntry* pToolbar = m_pPage->GetTopLevelSelection(); ToolbarSaveInData* pToolbarSaveInData = static_cast<ToolbarSaveInData*>( - pPage->GetSaveInData() ); + m_pPage->GetSaveInData() ); pToolbarSaveInData->ApplyToolbar( pToolbar ); } diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index 3437ca718166..2cdca489eb75 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -906,11 +906,6 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage(TabPageParent pParent, const SfxAcceleratorConfigPage::~SfxAcceleratorConfigPage() { - disposeOnce(); -} - -void SfxAcceleratorConfigPage::dispose() -{ m_aFillGroupIdle.Stop(); // free memory - remove all dynamic user data @@ -919,8 +914,6 @@ void SfxAcceleratorConfigPage::dispose() TAccInfo* pUserData = reinterpret_cast<TAccInfo*>(m_xEntriesBox->get_id(i).toInt64()); delete pUserData; } - - SfxTabPage::dispose(); } void SfxAcceleratorConfigPage::InitAccCfg() diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index def983911b70..0246f66d82a8 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -161,35 +161,35 @@ SvxConfigPage::CanConfig( const OUString& aModuleId ) return !(aModuleId == "com.sun.star.script.BasicIDE" || aModuleId == "com.sun.star.frame.Bibliography"); } -static VclPtr<SfxTabPage> CreateSvxMenuConfigPage( TabPageParent pParent, const SfxItemSet* rSet ) +static std::unique_ptr<SfxTabPage> CreateSvxMenuConfigPage( TabPageParent pParent, const SfxItemSet* rSet ) { - return VclPtr<SvxMenuConfigPage>::Create(pParent, *rSet); + return std::make_unique<SvxMenuConfigPage>(pParent, *rSet); } -static VclPtr<SfxTabPage> CreateSvxContextMenuConfigPage( TabPageParent pParent, const SfxItemSet* rSet ) +static std::unique_ptr<SfxTabPage> CreateSvxContextMenuConfigPage( TabPageParent pParent, const SfxItemSet* rSet ) { - return VclPtr<SvxMenuConfigPage>::Create(pParent, *rSet, false); + return std::make_unique<SvxMenuConfigPage>(pParent, *rSet, false); } -static VclPtr<SfxTabPage> CreateKeyboardConfigPage( TabPageParent pParent, const SfxItemSet* rSet ) +static std::unique_ptr<SfxTabPage> CreateKeyboardConfigPage( TabPageParent pParent, const SfxItemSet* rSet ) { - return VclPtr<SfxAcceleratorConfigPage>::Create(pParent, *rSet); + return std::make_unique<SfxAcceleratorConfigPage>(pParent, *rSet); } -static VclPtr<SfxTabPage> CreateSvxNotebookbarConfigPage(TabPageParent pParent, +static std::unique_ptr<SfxTabPage> CreateSvxNotebookbarConfigPage(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<SvxNotebookbarConfigPage>::Create(pParent, *rSet); + return std::make_unique<SvxNotebookbarConfigPage>(pParent, *rSet); } -static VclPtr<SfxTabPage> CreateSvxToolbarConfigPage( TabPageParent pParent, const SfxItemSet* rSet ) +static std::unique_ptr<SfxTabPage> CreateSvxToolbarConfigPage( TabPageParent pParent, const SfxItemSet* rSet ) { - return VclPtr<SvxToolbarConfigPage>::Create(pParent, *rSet); + return std::make_unique<SvxToolbarConfigPage>(pParent, *rSet); } -static VclPtr<SfxTabPage> CreateSvxEventConfigPage( TabPageParent pParent, const SfxItemSet* rSet ) +static std::unique_ptr<SfxTabPage> CreateSvxEventConfigPage( TabPageParent pParent, const SfxItemSet* rSet ) { - return VclPtr<SvxEventConfigPage>::Create(pParent, *rSet, SvxEventConfigPage::EarlyInit()); + return std::make_unique<SvxEventConfigPage>(pParent, *rSet, SvxEventConfigPage::EarlyInit()); } /****************************************************************************** @@ -927,7 +927,7 @@ void SvxMenuEntriesListBox::CreateDropDown() SvxMenuEntriesListBox::SvxMenuEntriesListBox(std::unique_ptr<weld::TreeView> xControl, SvxConfigPage* pPg) : m_xControl(std::move(xControl)) , m_xDropDown(m_xControl->create_virtual_device()) - , pPage(pPg) + , m_pPage(pPg) { CreateDropDown(); m_xControl->connect_key_press(LINK(this, SvxMenuEntriesListBox, KeyInputHdl)); @@ -944,16 +944,16 @@ IMPL_LINK(SvxMenuEntriesListBox, KeyInputHdl, const KeyEvent&, rKeyEvent, bool) // support DELETE for removing the current entry if ( keycode == KEY_DELETE ) { - pPage->DeleteSelectedContent(); + m_pPage->DeleteSelectedContent(); } // support CTRL+UP and CTRL+DOWN for moving selected entries else if ( keycode.GetCode() == KEY_UP && keycode.IsMod1() ) { - pPage->MoveEntry( true ); + m_pPage->MoveEntry( true ); } else if ( keycode.GetCode() == KEY_DOWN && keycode.IsMod1() ) { - pPage->MoveEntry( false ); + m_pPage->MoveEntry( false ); } else { @@ -1019,7 +1019,6 @@ IMPL_LINK_NOARG(SvxConfigPage, SelectElementHdl, weld::ComboBox&, void) SvxConfigPage::~SvxConfigPage() { - disposeOnce(); } void SvxConfigPage::Reset( const SfxItemSet* ) diff --git a/cui/source/customize/eventdlg.cxx b/cui/source/customize/eventdlg.cxx index 44ff4f9e9137..155708aba3ce 100644 --- a/cui/source/customize/eventdlg.cxx +++ b/cui/source/customize/eventdlg.cxx @@ -74,7 +74,6 @@ void SvxEventConfigPage::LateInit( const uno::Reference< frame::XFrame >& _rxFra SvxEventConfigPage::~SvxEventConfigPage() { - disposeOnce(); } void SvxEventConfigPage::ImplInitDocument() diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index 4a608f6c9883..d7d005487832 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -84,13 +84,7 @@ SvxMacroTabPage_::SvxMacroTabPage_(TabPageParent pParent, const OUString& rUIXML SvxMacroTabPage_::~SvxMacroTabPage_() { - disposeOnce(); -} - -void SvxMacroTabPage_::dispose() -{ mpImpl.reset(); - SfxTabPage::dispose(); } void SvxMacroTabPage_::InitResources() @@ -622,8 +616,7 @@ SvxMacroAssignDlg::SvxMacroAssignDlg(weld::Window* pParent, const Reference< fra : SvxMacroAssignSingleTabDialog(pParent, rSet) { TabPageParent pPageParent(get_content_area(), this); - auto pPage = VclPtr<SvxMacroTabPage>::Create(pPageParent, _rxDocumentFrame, rSet, xNameReplace, nSelectedIndex); - SetTabPage(pPage); + SetTabPage(std::make_unique<SvxMacroTabPage>(pPageParent, _rxDocumentFrame, rSet, xNameReplace, nSelectedIndex)); } IMPL_LINK_NOARG(AssignComponentDialog, ButtonHandler, weld::Button&, void) diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index d5043281cfac..360effa6dc5f 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -455,9 +455,9 @@ void SpellDialog::StartSpellOptDlg_Impl() SfxSingleTabDialogController aDlg(m_xDialog.get(), &aSet, "cui/ui/spelloptionsdialog.ui", "SpellOptionsDialog"); TabPageParent aParent(aDlg.get_content_area(), &aDlg); - VclPtr<SfxTabPage> xPage = SvxLinguTabPage::Create(aParent, &aSet); + std::unique_ptr<SfxTabPage> xPage = SvxLinguTabPage::Create(aParent, &aSet); static_cast<SvxLinguTabPage*>(xPage.get())->HideGroups( GROUP_MODULES ); - aDlg.SetTabPage(xPage); + aDlg.SetTabPage(std::move(xPage)); if (RET_OK == aDlg.run()) { InitUserDicts(); diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx index 54d7894d4fe9..b7fdc641da19 100644 --- a/cui/source/dialogs/cuigaldlg.cxx +++ b/cui/source/dialogs/cuigaldlg.cxx @@ -189,7 +189,7 @@ void SearchThread::ImplSearch( const INetURLObject& rStartURL, SearchProgress::SearchProgress(weld::Window* pParent, TPGalleryThemeProperties* pTabPage, const INetURLObject& rStartURL) : GenericDialogController(pParent, "cui/ui/gallerysearchprogress.ui", "GallerySearchProgress") , startUrl_(rStartURL) - , m_xTabPage(pTabPage) + , m_pTabPage(pTabPage) , m_xFtSearchDir(m_xBuilder->weld_label("dir")) , m_xFtSearchType(m_xBuilder->weld_label("file")) , m_xBtnCancel(m_xBuilder->weld_button("cancel")) @@ -219,7 +219,7 @@ IMPL_LINK_NOARG(SearchProgress, CleanUpHdl, void*, void) void SearchProgress::LaunchThread() { assert(!m_aSearchThread.is()); - m_aSearchThread = new SearchThread(this, m_xTabPage, startUrl_); + m_aSearchThread = new SearchThread(this, m_pTabPage, startUrl_); m_aSearchThread->launch(); } @@ -291,7 +291,7 @@ TakeProgress::TakeProgress(weld::Window* pParent, TPGalleryThemeProperties* pTab : GenericDialogController(pParent, "cui/ui/galleryapplyprogress.ui", "GalleryApplyProgress") , m_pParent(pParent) - , m_xTabPage(pTabPage) + , m_pTabPage(pTabPage) , m_xFtTakeFile(m_xBuilder->weld_label("file")) , m_xBtnCancel(m_xBuilder->weld_button("cancel")) { @@ -314,14 +314,14 @@ IMPL_LINK_NOARG(TakeProgress, CleanUpHdl, void*, void) if (maTakeThread.is()) maTakeThread->join(); - std::vector<bool, std::allocator<bool> > aRemoveEntries(m_xTabPage->aFoundList.size(), false); + std::vector<bool, std::allocator<bool> > aRemoveEntries(m_pTabPage->aFoundList.size(), false); std::vector< OUString > aRemainingVector; sal_uInt32 i, nCount; std::unique_ptr<weld::WaitObject> xWait(new weld::WaitObject(m_pParent)); - m_xTabPage->m_xLbxFound->select(-1); - m_xTabPage->m_xLbxFound->freeze(); + m_pTabPage->m_xLbxFound->select(-1); + m_pTabPage->m_xLbxFound->freeze(); // mark all taken positions in aRemoveEntries for( i = 0, nCount = maTakenList.size(); i < nCount; ++i ) @@ -331,29 +331,29 @@ IMPL_LINK_NOARG(TakeProgress, CleanUpHdl, void*, void) // refill found list for( i = 0, nCount = aRemoveEntries.size(); i < nCount; ++i ) if( !aRemoveEntries[ i ] ) - aRemainingVector.push_back( m_xTabPage->aFoundList[i] ); + aRemainingVector.push_back( m_pTabPage->aFoundList[i] ); - m_xTabPage->aFoundList.clear(); + m_pTabPage->aFoundList.clear(); for( i = 0, nCount = aRemainingVector.size(); i < nCount; ++i ) - m_xTabPage->aFoundList.push_back( aRemainingVector[ i ] ); + m_pTabPage->aFoundList.push_back( aRemainingVector[ i ] ); aRemainingVector.clear(); // refill list box for( i = 0, nCount = aRemoveEntries.size(); i < nCount; ++i ) if( !aRemoveEntries[ i ] ) - aRemainingVector.push_back(m_xTabPage->m_xLbxFound->get_text(i)); + aRemainingVector.push_back(m_pTabPage->m_xLbxFound->get_text(i)); - m_xTabPage->m_xLbxFound->clear(); + m_pTabPage->m_xLbxFound->clear(); for( i = 0, nCount = aRemainingVector.size(); i < nCount; ++i ) - m_xTabPage->m_xLbxFound->append_text(aRemainingVector[i]); + m_pTabPage->m_xLbxFound->append_text(aRemainingVector[i]); aRemainingVector.clear(); - m_xTabPage->m_xLbxFound->thaw(); - m_xTabPage->SelectFoundHdl( *m_xTabPage->m_xLbxFound ); + m_pTabPage->m_xLbxFound->thaw(); + m_pTabPage->SelectFoundHdl( *m_pTabPage->m_xLbxFound ); xWait.reset(); @@ -363,7 +363,7 @@ IMPL_LINK_NOARG(TakeProgress, CleanUpHdl, void*, void) void TakeProgress::LaunchThread() { assert(!maTakeThread.is()); - maTakeThread = new TakeThread(this, m_xTabPage, maTakenList); + maTakeThread = new TakeThread(this, m_pTabPage, maTakenList); maTakeThread->launch(); } @@ -574,9 +574,9 @@ bool TPGalleryThemeGeneral::FillItemSet( SfxItemSet* /*rSet*/ ) return true; } -VclPtr<SfxTabPage> TPGalleryThemeGeneral::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> TPGalleryThemeGeneral::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<TPGalleryThemeGeneral>::Create(pParent, *rSet); + return std::make_unique<TPGalleryThemeGeneral>(pParent, *rSet); } TPGalleryThemeProperties::TPGalleryThemeProperties(TabPageParent pWindow, const SfxItemSet& rSet) @@ -636,20 +636,14 @@ void TPGalleryThemeProperties::StartSearchFiles( const OUString& _rFolderURL, sh TPGalleryThemeProperties::~TPGalleryThemeProperties() { - disposeOnce(); -} - -void TPGalleryThemeProperties::dispose() -{ xMediaPlayer.clear(); xDialogListener.clear(); aFilterEntryList.clear(); - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> TPGalleryThemeProperties::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> TPGalleryThemeProperties::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<TPGalleryThemeProperties>::Create(pParent, *rSet); + return std::make_unique<TPGalleryThemeProperties>(pParent, *rSet); } OUString TPGalleryThemeProperties::addExtension( const OUString& _rDisplayText, const OUString& _rExtension ) diff --git a/cui/source/inc/SvxMenuConfigPage.hxx b/cui/source/inc/SvxMenuConfigPage.hxx index 309428d41c2a..78061d9fd562 100644 --- a/cui/source/inc/SvxMenuConfigPage.hxx +++ b/cui/source/inc/SvxMenuConfigPage.hxx @@ -58,7 +58,6 @@ private: public: SvxMenuConfigPage(TabPageParent pParent, const SfxItemSet& rItemSet, bool bIsMenuBar = true); virtual ~SvxMenuConfigPage() override; - virtual void dispose() override; SaveInData* CreateSaveInData( const css::uno::Reference < diff --git a/cui/source/inc/SvxToolbarConfigPage.hxx b/cui/source/inc/SvxToolbarConfigPage.hxx index c7e86e6a34df..a4998e9862d6 100644 --- a/cui/source/inc/SvxToolbarConfigPage.hxx +++ b/cui/source/inc/SvxToolbarConfigPage.hxx @@ -57,7 +57,6 @@ private: public: SvxToolbarConfigPage(TabPageParent pParent, const SfxItemSet& rItemSet); virtual ~SvxToolbarConfigPage() override; - virtual void dispose() override; void AddFunction(int nTarget = -1); diff --git a/cui/source/inc/acccfg.hxx b/cui/source/inc/acccfg.hxx index e61fe5199832..c351274dc281 100644 --- a/cui/source/inc/acccfg.hxx +++ b/cui/source/inc/acccfg.hxx @@ -141,7 +141,6 @@ private: public: SfxAcceleratorConfigPage(TabPageParent pParent, const SfxItemSet& rItemSet); virtual ~SfxAcceleratorConfigPage() override; - virtual void dispose() override; virtual bool FillItemSet( SfxItemSet* ) override; virtual void Reset( const SfxItemSet* ) override; diff --git a/cui/source/inc/align.hxx b/cui/source/inc/align.hxx index 063d5b1f59f5..69ae8ead2e82 100644 --- a/cui/source/inc/align.hxx +++ b/cui/source/inc/align.hxx @@ -46,25 +46,20 @@ namespace svx { class AlignmentTabPage : public SfxTabPage { - using TabPage::DeactivatePage; - friend class VclPtr<AlignmentTabPage>; static const sal_uInt16 s_pRanges[]; public: virtual ~AlignmentTabPage() override; - virtual void dispose() override; + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet ); + explicit AlignmentTabPage(TabPageParent pParent, const SfxItemSet& rCoreSet); - static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet ); static const sal_uInt16* GetRanges() { return s_pRanges; } virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; - virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; private: - explicit AlignmentTabPage(TabPageParent pParent, const SfxItemSet& rCoreSet); - void InitVsRefEgde(); void UpdateEnableControls(); diff --git a/cui/source/inc/autocdlg.hxx b/cui/source/inc/autocdlg.hxx index 8d2c9ea1c0d9..61a239b968bf 100644 --- a/cui/source/inc/autocdlg.hxx +++ b/cui/source/inc/autocdlg.hxx @@ -51,8 +51,6 @@ public: class OfaAutocorrOptionsPage : public SfxTabPage { - using TabPage::ActivatePage; - private: OUString m_sInput; OUString m_sDoubleCaps; @@ -71,7 +69,7 @@ public: OfaAutocorrOptionsPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~OfaAutocorrOptionsPage() override; - static VclPtr<SfxTabPage> Create( TabPageParent pParent, + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet); virtual bool FillItemSet( SfxItemSet* rSet ) override; @@ -84,9 +82,6 @@ public: class OfaSwAutoFmtOptionsPage : public SfxTabPage { - friend class VclPtr<OfaSwAutoFmtOptionsPage>; - using TabPage::ActivatePage; - OUString sDeleteEmptyPara; OUString sUseReplaceTbl; OUString sCapitalStartWord; @@ -123,13 +118,12 @@ class OfaSwAutoFmtOptionsPage : public SfxTabPage void CreateEntry(const OUString& rTxt, sal_uInt16 nCol); +public: OfaSwAutoFmtOptionsPage(TabPageParent pParent, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, + const SfxItemSet* rAttrSet); virtual ~OfaSwAutoFmtOptionsPage() override; - virtual void dispose() override; -public: - static VclPtr<SfxTabPage> Create( TabPageParent pParent, - const SfxItemSet* rAttrSet); virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; virtual void ActivatePage( const SfxItemSet& ) override; @@ -156,9 +150,6 @@ typedef std::map<LanguageType, StringChangeList> StringChangeTable; class OfaAutocorrReplacePage : public SfxTabPage { - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - private: StringChangeTable aChangesTable; @@ -201,9 +192,8 @@ private: public: OfaAutocorrReplacePage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~OfaAutocorrReplacePage() 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; @@ -228,9 +218,6 @@ typedef std::map<LanguageType, StringsArrays> StringsTable; class OfaAutocorrExceptPage : public SfxTabPage { - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - private: StringsTable aStringsTable; std::unique_ptr<CollatorWrapper> pCompareClass; @@ -260,9 +247,8 @@ private: public: OfaAutocorrExceptPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~OfaAutocorrExceptPage() override; - virtual void dispose() override; - static VclPtr<SfxTabPage> Create( TabPageParent pParent, + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet); virtual bool FillItemSet( SfxItemSet* rSet ) override; @@ -277,9 +263,6 @@ public: class OfaQuoteTabPage : public SfxTabPage { - friend class VclPtr<OfaQuoteTabPage>; - using TabPage::ActivatePage; - private: OUString sNonBrkSpace; OUString sOrdinal; @@ -317,12 +300,11 @@ private: static void CreateEntry(weld::TreeView& rLstBox, const OUString& rTxt, sal_uInt16 nCol, sal_uInt16 nTextCol); - OfaQuoteTabPage(TabPageParent pParent, const SfxItemSet& rSet); public: - virtual ~OfaQuoteTabPage() override; - - static VclPtr<SfxTabPage> Create(TabPageParent pParent, + OfaQuoteTabPage(TabPageParent pParent, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet); + virtual ~OfaQuoteTabPage() override; virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; @@ -333,9 +315,7 @@ public: class OfaAutoCompleteTabPage : public SfxTabPage { - friend class VclPtr<OfaAutoCompleteTabPage>; private: - using TabPage::ActivatePage; editeng::SortedAutoCompleteStrings* m_pAutoCompleteList; sal_uInt16 m_nAutoCmpltListCnt; @@ -355,11 +335,11 @@ private: DECL_LINK(CheckHdl, weld::ToggleButton&, void); DECL_LINK(KeyReleaseHdl, const KeyEvent&, bool); - OfaAutoCompleteTabPage(TabPageParent pParent, const SfxItemSet& rSet); public: - virtual ~OfaAutoCompleteTabPage() override; - static VclPtr<SfxTabPage> Create(TabPageParent pParent, + OfaAutoCompleteTabPage(TabPageParent pParent, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet); + virtual ~OfaAutoCompleteTabPage() override; virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; @@ -377,8 +357,6 @@ public: */ class OfaSmartTagOptionsTabPage : public SfxTabPage { - using TabPage::ActivatePage; - private: // controls @@ -423,7 +401,7 @@ public: OfaSmartTagOptionsTabPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~OfaSmartTagOptionsTabPage() 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/cui/source/inc/backgrnd.hxx b/cui/source/inc/backgrnd.hxx index 099997775374..86d52da29511 100644 --- a/cui/source/inc/backgrnd.hxx +++ b/cui/source/inc/backgrnd.hxx @@ -42,11 +42,12 @@ class SvxBrushItem; class SvxBackgroundTabPage : public SvxTabPage { - using TabPage::DeactivatePage; - friend class VclPtr<SvxBackgroundTabPage>; static const sal_uInt16 pPageRanges[]; public: - static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet ); + SvxBackgroundTabPage(TabPageParent pParent, const SfxItemSet& rCoreSet); + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet ); + virtual ~SvxBackgroundTabPage() override; + // returns the area of the which-values static const sal_uInt16* GetRanges() { return pPageRanges; } @@ -65,10 +66,6 @@ protected: virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; private: - SvxBackgroundTabPage(TabPageParent pParent, const SfxItemSet& rCoreSet); - virtual ~SvxBackgroundTabPage() override; - virtual void dispose() override; - // DDListBox for Writer ------------------------------- Color aBgdColor; @@ -166,14 +163,10 @@ class SvxBkgTabPage : public SvxAreaTabPage DECL_LINK(TblDestinationHdl_Impl, weld::ComboBox&, void); public: - using SvxAreaTabPage::ActivatePage; - using SvxAreaTabPage::DeactivatePage; - SvxBkgTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); virtual ~SvxBkgTabPage() override; - virtual void dispose() override; - static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); + static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); virtual bool FillItemSet( SfxItemSet* ) override; virtual void ActivatePage( const SfxItemSet& ) override; virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; diff --git a/cui/source/inc/border.hxx b/cui/source/inc/border.hxx index 92790ea285e5..30e2ad5318df 100644 --- a/cui/source/inc/border.hxx +++ b/cui/source/inc/border.hxx @@ -76,15 +76,12 @@ private: class SvxBorderTabPage : public SfxTabPage { - friend class VclPtr<SvxBorderTabPage>; - using TabPage::DeactivatePage; - static const sal_uInt16 pRanges[]; public: + SvxBorderTabPage(TabPageParent pParent, const SfxItemSet& rCoreAttrs); virtual ~SvxBorderTabPage() override; - virtual void dispose() override; - static VclPtr<SfxTabPage> Create( TabPageParent pParent, + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet); static const sal_uInt16* GetRanges() { return pRanges; } @@ -97,11 +94,8 @@ public: void SetTableMode(); protected: virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; - virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; private: - SvxBorderTabPage(TabPageParent pParent, const SfxItemSet& rCoreAttrs); - std::vector<Image> m_aShadowImgVec; std::vector<Image> m_aBorderImgVec; diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx index 4b4e308803bd..eeb7644049b8 100644 --- a/cui/source/inc/cfg.hxx +++ b/cui/source/inc/cfg.hxx @@ -318,7 +318,7 @@ class SvxMenuEntriesListBox protected: std::unique_ptr<weld::TreeView> m_xControl; ScopedVclPtr<VirtualDevice> m_xDropDown; - VclPtr<SvxConfigPage> pPage; + SvxConfigPage* m_pPage; public: SvxMenuEntriesListBox(std::unique_ptr<weld::TreeView> xControl, SvxConfigPage* pPage); diff --git a/cui/source/inc/chardlg.hxx b/cui/source/inc/chardlg.hxx index 68e6879e92e0..8d98176d3bfc 100644 --- a/cui/source/inc/chardlg.hxx +++ b/cui/source/inc/chardlg.hxx @@ -52,11 +52,7 @@ protected: public: virtual ~SvxCharBasePage() override; - using SfxTabPage::ActivatePage; - using SfxTabPage::DeactivatePage; - virtual void ActivatePage( const SfxItemSet& rSet ) override; - }; // class SvxCharNamePage ------------------------------------------------- @@ -65,8 +61,6 @@ struct SvxCharNamePage_Impl; class SvxCharNamePage : public SvxCharBasePage { - friend class VclPtr<SvxCharNamePage>; - private: static const sal_uInt16 pNameRanges[]; @@ -108,8 +102,6 @@ private: std::unique_ptr<weld::Label> m_xCTLFontTypeFT; std::unique_ptr<weld::Button> m_xCTLFontFeaturesButton; - SvxCharNamePage(TabPageParent pParent, const SfxItemSet& rSet); - void Initialize(); const FontList* GetFontList() const; void UpdatePreview_Impl(); @@ -142,17 +134,14 @@ private: void FontModifyHdl_Impl(const weld::Widget&); public: - using SfxTabPage::ActivatePage; - using SfxTabPage::DeactivatePage; - virtual void ActivatePage( const SfxItemSet& rSet ) override; virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; public: - virtual ~SvxCharNamePage() override; - virtual void dispose() override; + SvxCharNamePage(TabPageParent pParent, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); + virtual ~SvxCharNamePage() override; - static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); static const sal_uInt16* GetRanges() { return pNameRanges; } virtual void Reset( const SfxItemSet* rSet ) override; @@ -171,8 +160,6 @@ public: class SvxCharEffectsPage : public SvxCharBasePage { - friend class VclPtr<SvxCharEffectsPage>; - private: static const sal_uInt16 pEffectsRanges[]; bool m_bOrigFontColor; @@ -206,8 +193,6 @@ private: std::unique_ptr<weld::ComboBox> m_xPositionLB; std::unique_ptr<weld::Label> m_xA11yWarningFT; - SvxCharEffectsPage(TabPageParent pParent, const SfxItemSet& rSet); - void Initialize(); void UpdatePreview_Impl(); void SetCaseMap_Impl( SvxCaseMap eCaseMap ); @@ -224,14 +209,13 @@ private: DECL_LINK(ColorBoxSelectHdl_Impl, ColorListBox&, void); public: + SvxCharEffectsPage(TabPageParent pParent, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); virtual ~SvxCharEffectsPage() override; - virtual void dispose() override; - using SfxTabPage::DeactivatePage; virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; public: - static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); static const sal_uInt16* GetRanges() { return pEffectsRanges; } virtual void Reset( const SfxItemSet* rSet ) override; @@ -243,11 +227,8 @@ public: }; // class SvxCharPositionPage --------------------------------------------- - - class SvxCharPositionPage : public SvxCharBasePage { - friend class VclPtr<SvxCharPositionPage>; static const sal_uInt16 pPositionRanges[]; private: @@ -283,8 +264,6 @@ private: std::unique_ptr<weld::MetricSpinButton> m_xKerningMF; std::unique_ptr<weld::CheckButton> m_xPairKerningBtn; - SvxCharPositionPage(TabPageParent pParent, const SfxItemSet& rSet); - void Initialize(); void UpdatePreview_Impl( sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc ); void SetEscapement_Impl( SvxEscapement nEsc ); @@ -300,14 +279,13 @@ private: void FontModifyHdl_Impl(); public: + SvxCharPositionPage(TabPageParent pParent, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); virtual ~SvxCharPositionPage() override; - using SfxTabPage::DeactivatePage; - virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; public: - static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); static const sal_uInt16* GetRanges() { return pPositionRanges; } virtual void Reset( const SfxItemSet* rSet ) override; @@ -321,7 +299,6 @@ public: class SvxCharTwoLinesPage : public SvxCharBasePage { - friend class VclPtr<SvxCharTwoLinesPage>; private: static const sal_uInt16 pTwoLinesRanges[]; sal_uInt16 m_nStartBracketPosition; @@ -332,8 +309,6 @@ private: std::unique_ptr<weld::TreeView> m_xStartBracketLB; std::unique_ptr<weld::TreeView> m_xEndBracketLB; - SvxCharTwoLinesPage(TabPageParent pParent, const SfxItemSet& rSet); - void UpdatePreview_Impl(); void Initialize(); void SelectCharacter(weld::TreeView* pBox); @@ -343,15 +318,13 @@ private: DECL_LINK(CharacterMapHdl_Impl, weld::TreeView&, void); public: + SvxCharTwoLinesPage(TabPageParent pParent, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); virtual ~SvxCharTwoLinesPage() override; - using SfxTabPage::ActivatePage; - using SfxTabPage::DeactivatePage; - virtual void ActivatePage( const SfxItemSet& rSet ) override; virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; - static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); static const sal_uInt16* GetRanges() { return pTwoLinesRanges; } virtual void Reset( const SfxItemSet* rSet ) override; diff --git a/cui/source/inc/connect.hxx b/cui/source/inc/connect.hxx index 70e54e6fd8f4..d89fa4521676 100644 --- a/cui/source/inc/connect.hxx +++ b/cui/source/inc/connect.hxx @@ -60,9 +60,8 @@ public: SvxConnectionPage(TabPageParent pWindow, const SfxItemSet& rInAttrs); virtual ~SvxConnectionPage() override; - virtual void dispose() override; - static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); + static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); static const sal_uInt16* GetRanges() { return pRanges; } virtual bool FillItemSet( SfxItemSet* ) override; diff --git a/cui/source/inc/cuigaldlg.hxx b/cui/source/inc/cuigaldlg.hxx index 064bc660bb2e..751557c850fa 100644 --- a/cui/source/inc/cuigaldlg.hxx +++ b/cui/source/inc/cuigaldlg.hxx @@ -50,7 +50,7 @@ class SearchThread: public salhelper::Thread private: SearchProgress* mpProgress; - VclPtr<TPGalleryThemeProperties> mpBrowser; + TPGalleryThemeProperties* mpBrowser; INetURLObject maStartURL; void ImplSearch( const INetURLObject& rStartURL, @@ -71,7 +71,7 @@ class SearchProgress : public weld::GenericDialogController { private: INetURLObject startUrl_; - VclPtr<TPGalleryThemeProperties> m_xTabPage; + TPGalleryThemeProperties* m_pTabPage; rtl::Reference< SearchThread > m_aSearchThread; std::unique_ptr<weld::Label> m_xFtSearchDir; std::unique_ptr<weld::Label> m_xFtSearchType; @@ -95,7 +95,7 @@ class TakeThread: public salhelper::Thread private: TakeProgress* mpProgress; - VclPtr<TPGalleryThemeProperties> mpBrowser; + TPGalleryThemeProperties* mpBrowser; TokenList_impl& mrTakenList; virtual ~TakeThread() override; @@ -114,7 +114,7 @@ class TakeProgress : public weld::GenericDialogController { private: weld::Window* m_pParent; - VclPtr<TPGalleryThemeProperties> m_xTabPage; + TPGalleryThemeProperties* m_pTabPage; rtl::Reference< TakeThread > maTakeThread; TokenList_impl maTakenList; std::unique_ptr<weld::Label> m_xFtTakeFile; @@ -205,7 +205,7 @@ private: public: TPGalleryThemeGeneral(TabPageParent pParent, const SfxItemSet& rSet); void SetXChgData( ExchangeData* pData ); - static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); }; class TPGalleryThemeProperties : public SfxTabPage @@ -263,14 +263,13 @@ class TPGalleryThemeProperties : public SfxTabPage public: TPGalleryThemeProperties(TabPageParent pWindow, const SfxItemSet& rSet); virtual ~TPGalleryThemeProperties() override; - virtual void dispose() override; void SetXChgData( ExchangeData* pData ); const ExchangeData* GetXChgData() const { return pData; } void StartSearchFiles( const OUString& _rFolderURL, short _nDlgResult ); - static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet); + static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet); }; #endif // INCLUDED_CUI_SOURCE_INC_CUIGALDLG_HXX diff --git a/cui/source/inc/cuioptgenrl.hxx b/cui/source/inc/cuioptgenrl.hxx index 204cab1e90c7..64c152699315 100644 --- a/cui/source/inc/cuioptgenrl.hxx +++ b/cui/source/inc/cuioptgenrl.hxx @@ -30,7 +30,6 @@ class SvxGeneralTabPage : public SfxTabPage { - using TabPage::DeactivatePage; private: // the "Use data for document properties" checkbox std::unique_ptr<weld::CheckButton> m_xUseDataCB; @@ -64,7 +63,7 @@ public: SvxGeneralTabPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SvxGeneralTabPage() 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/cui/source/inc/cuisrchdlg.hxx b/cui/source/inc/cuisrchdlg.hxx index 08b18187f30f..fc16a4a10d51 100644 --- a/cui/source/inc/cuisrchdlg.hxx +++ b/cui/source/inc/cuisrchdlg.hxx @@ -26,7 +26,7 @@ class SvxJSearchOptionsPage; class SvxJSearchOptionsDialog : public SfxSingleTabDialogController { - VclPtr<SvxJSearchOptionsPage> m_xPage; + SvxJSearchOptionsPage* m_pPage; SvxJSearchOptionsDialog( const SvxJSearchOptionsDialog & ) = delete; SvxJSearchOptionsDialog & operator == ( const SvxJSearchOptionsDialog & ) = delete; diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx index 652e38b59d07..368090dc14bf 100644 --- a/cui/source/inc/cuitabarea.hxx +++ b/cui/source/inc/cuitabarea.hxx @@ -128,8 +128,6 @@ public: class SvxTransparenceTabPage : public SfxTabPage { - using TabPage::ActivatePage; - using TabPage::DeactivatePage; static const sal_uInt16 pTransparenceRanges[]; const SfxItemSet& rOutAttrs; @@ -191,7 +189,7 @@ public: SvxTransparenceTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); virtual ~SvxTransparenceTabPage() override; - static VclPtr<SfxTabPage> Create(TabPageParent, const SfxItemSet*); + static std::unique_ptr<SfxTabPage> Create(TabPageParent, const SfxItemSet*); static const sal_uInt16* GetRanges() { return pTransparenceRanges; } virtual bool FillItemSet(SfxItemSet*) override; @@ -211,7 +209,7 @@ class SvxAreaTabPage : public SfxTabPage { static const sal_uInt16 pAreaRanges[]; private: - ScopedVclPtr<SfxTabPage> m_pFillTabPage; + std::unique_ptr<SfxTabPage> m_xFillTabPage; ButtonBox maBox; XColorListRef m_pColorList; @@ -249,7 +247,7 @@ protected: void SetOptimalSize(weld::DialogController* pController); void SelectFillType( weld::ToggleButton& rButton, const SfxItemSet* _pSet = nullptr ); - SfxTabPage* GetFillTabPage() { return m_pFillTabPage; } + SfxTabPage* GetFillTabPage() { return m_xFillTabPage.get(); } bool IsBtnClicked() const { return m_bBtnClicked; } @@ -264,14 +262,10 @@ private: DeactivateRC DeactivatePage_Impl( SfxItemSet* pSet ); public: - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - SvxAreaTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); virtual ~SvxAreaTabPage() override; - virtual void dispose() override; - static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); + static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); static const sal_uInt16* GetRanges() { return pAreaRanges; } virtual bool FillItemSet( SfxItemSet* ) override; @@ -298,8 +292,6 @@ public: class SvxShadowTabPage : public SvxTabPage { - using TabPage::ActivatePage; - using TabPage::DeactivatePage; static const sal_uInt16 pShadowRanges[]; private: @@ -331,9 +323,8 @@ private: public: SvxShadowTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); virtual ~SvxShadowTabPage() override; - virtual void dispose() override; - static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); + static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); static const sal_uInt16* GetRanges() { return pShadowRanges; } virtual bool FillItemSet( SfxItemSet* ) override; @@ -353,9 +344,6 @@ public: class SvxGradientTabPage : public SfxTabPage { - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - private: const SfxItemSet& m_rOutAttrs; @@ -410,11 +398,10 @@ private: public: SvxGradientTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); virtual ~SvxGradientTabPage() override; - virtual void dispose() override; void Construct(); - static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); + static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); virtual bool FillItemSet( SfxItemSet* ) override; virtual void Reset( const SfxItemSet * ) override; @@ -432,9 +419,6 @@ public: class SvxHatchTabPage : public SfxTabPage { - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - private: const SfxItemSet& m_rOutAttrs; @@ -482,11 +466,10 @@ private: public: SvxHatchTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); virtual ~SvxHatchTabPage() override; - virtual void dispose() override; void Construct(); - static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); + static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); virtual bool FillItemSet( SfxItemSet* ) override; virtual void Reset( const SfxItemSet * ) override; @@ -499,16 +482,12 @@ public: void SetHtchChgd( ChangeType* pIn ) { m_pnHatchingListState = pIn; } void SetColorChgd( ChangeType* pIn ) { m_pnColorListState = pIn; } - - virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; }; /************************************************************************/ class SvxBitmapTabPage : public SfxTabPage { - using TabPage::ActivatePage; - using TabPage::DeactivatePage; static const sal_uInt16 pBitmapRanges[]; private: @@ -567,11 +546,10 @@ private: public: SvxBitmapTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); virtual ~SvxBitmapTabPage() override; - virtual void dispose() override; void Construct(); - static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); + static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); virtual bool FillItemSet( SfxItemSet* ) override; virtual void Reset( const SfxItemSet * ) override; @@ -586,9 +564,6 @@ public: class SvxPatternTabPage : public SvxTabPage { - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - private: const SfxItemSet& m_rOutAttrs; @@ -625,11 +600,10 @@ private: public: SvxPatternTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); virtual ~SvxPatternTabPage() override; - virtual void dispose() override; void Construct(); - static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); + static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); virtual bool FillItemSet( SfxItemSet* ) override; virtual void Reset( const SfxItemSet * ) override; @@ -655,9 +629,6 @@ enum class ColorModel class SvxColorTabPage : public SfxTabPage { - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - private: const SfxItemSet& rOutAttrs; @@ -743,11 +714,10 @@ private: public: SvxColorTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); virtual ~SvxColorTabPage() override; - virtual void dispose() override; void Construct(); - static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); + static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); virtual bool FillItemSet( SfxItemSet* ) override; virtual void Reset( const SfxItemSet * ) override; diff --git a/cui/source/inc/cuitabline.hxx b/cui/source/inc/cuitabline.hxx index 305c6b3d3f90..ae42ecc947bb 100644 --- a/cui/source/inc/cuitabline.hxx +++ b/cui/source/inc/cuitabline.hxx @@ -87,8 +87,6 @@ struct SvxBmpItemInfo class SvxLineTabPage : public SfxTabPage { - using TabPage::ActivatePage; - using TabPage::DeactivatePage; static const sal_uInt16 pLineRanges[]; private: //#58425# symbols on a line (e. g. StarChart) -> @@ -204,11 +202,10 @@ public: SvxLineTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); virtual ~SvxLineTabPage() override; - virtual void dispose() override; void Construct(); - static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); + static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); static const sal_uInt16* GetRanges() { return pLineRanges; } virtual bool FillItemSet( SfxItemSet* ) override; @@ -233,15 +230,12 @@ public: void SetColorChgd( ChangeType* pIn ) { m_pnColorListState = pIn; } virtual void PageCreated(const SfxAllItemSet& aSet) override; - virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; }; /*************************************************************************/ class SvxLineDefTabPage : public SfxTabPage { - using TabPage::ActivatePage; - using TabPage::DeactivatePage; private: const SfxItemSet& rOutAttrs; XDash aDash; @@ -299,11 +293,10 @@ private: public: SvxLineDefTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); virtual ~SvxLineDefTabPage() override; - virtual void dispose() override; void Construct(); - static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); + static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); virtual bool FillItemSet( SfxItemSet* ) override; virtual void Reset( const SfxItemSet * ) override; @@ -317,17 +310,12 @@ public: void SetPosDashLb( sal_Int32* pInPos ) { pPosDashLb = pInPos; } void SetDashChgd( ChangeType* pIn ) { pnDashListState = pIn; } - - virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; }; /*************************************************************************/ class SvxLineEndDefTabPage : public SfxTabPage { - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - private: const SfxItemSet& rOutAttrs; const SdrObject* pPolyObj; @@ -365,11 +353,10 @@ private: public: SvxLineEndDefTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); virtual ~SvxLineEndDefTabPage() override; - virtual void dispose() override; void Construct(); - static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); + static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); virtual bool FillItemSet( SfxItemSet* ) override; virtual void Reset( const SfxItemSet * ) override; @@ -384,8 +371,6 @@ public: void SetPosLineEndLb( sal_Int32* pInPos ) { pPosLineEndLb = pInPos; } void SetLineEndChgd( ChangeType* pIn ) { pnLineEndListState = pIn; } - - virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; }; #endif // INCLUDED_CUI_SOURCE_INC_CUITABLINE_HXX diff --git a/cui/source/inc/dbregister.hxx b/cui/source/inc/dbregister.hxx index b177fb3b0de2..dc3d9d17b232 100644 --- a/cui/source/inc/dbregister.hxx +++ b/cui/source/inc/dbregister.hxx @@ -70,9 +70,8 @@ namespace svx public: DbRegistrationOptionsPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~DbRegistrationOptionsPage() 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 bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; diff --git a/cui/source/inc/dstribut.hxx b/cui/source/inc/dstribut.hxx index f1e7dbe6f718..7e3987a795e1 100644 --- a/cui/source/inc/dstribut.hxx +++ b/cui/source/inc/dstribut.hxx @@ -54,7 +54,7 @@ public: class SvxDistributeDialog : public SfxSingleTabDialogController { - VclPtr<SvxDistributePage> mpPage; + SvxDistributePage* mpPage; public: SvxDistributeDialog(weld::Window* pParent, const SfxItemSet& rAttr, diff --git a/cui/source/inc/grfpage.hxx b/cui/source/inc/grfpage.hxx index 9843e32387e4..1294c2cbab77 100644 --- a/cui/source/inc/grfpage.hxx +++ b/cui/source/inc/grfpage.hxx @@ -49,9 +49,6 @@ public: class SvxGrfCropPage : public SfxTabPage { friend class VclPtr<SvxGrfCropPage>; - using Window::CalcZoom; - using TabPage::ActivatePage; - using TabPage::DeactivatePage; OUString aGraphicName; Size aOrigSize; @@ -86,10 +83,6 @@ class SvxGrfCropPage : public SfxTabPage // Example std::unique_ptr<weld::CustomWeld> m_xExampleWN; - SvxGrfCropPage(TabPageParent pParent, const SfxItemSet &rSet); - virtual ~SvxGrfCropPage() override; - virtual void dispose() override; - DECL_LINK(ZoomHdl, weld::MetricSpinButton&, void); DECL_LINK(SizeHdl, weld::MetricSpinButton&, void); DECL_LINK(CropModifyHdl, weld::MetricSpinButton&, void); @@ -100,9 +93,11 @@ class SvxGrfCropPage : public SfxTabPage void GraphicHasChanged(bool bFound); virtual void ActivatePage(const SfxItemSet& rSet) override; - Size GetGrfOrigSize( const Graphic& ) const; + static Size GetGrfOrigSize(const Graphic&); public: - static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet *rSet ); + SvxGrfCropPage(TabPageParent pParent, const SfxItemSet &rSet); + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet *rSet ); + virtual ~SvxGrfCropPage() override; virtual bool FillItemSet( SfxItemSet *rSet ) override; virtual void Reset( const SfxItemSet *rSet ) override; diff --git a/cui/source/inc/labdlg.hxx b/cui/source/inc/labdlg.hxx index 07d802a730b3..267d4b8f9233 100644 --- a/cui/source/inc/labdlg.hxx +++ b/cui/source/inc/labdlg.hxx @@ -80,9 +80,8 @@ private: public: SvxCaptionTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); virtual ~SvxCaptionTabPage() override; - virtual void dispose() override; - static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); + static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); static const sal_uInt16* GetRanges() { return pCaptionRanges; } virtual bool FillItemSet( SfxItemSet* ) override; @@ -91,7 +90,6 @@ public: void SetView( const SdrView* pSdrView ) { pView = pSdrView; } - virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; void FillValueSet(); }; diff --git a/cui/source/inc/macroass.hxx b/cui/source/inc/macroass.hxx index 0ad8c4816bd2..07ed15d2108a 100644 --- a/cui/source/inc/macroass.hxx +++ b/cui/source/inc/macroass.hxx @@ -57,13 +57,11 @@ public: ); virtual ~SfxMacroTabPage() override; - virtual void dispose() override; void AddEvent( const OUString & rEventName, SvMacroItemId nEventId ); void ScriptChanged(); virtual void PageCreated (const SfxAllItemSet& aSet) override; - using TabPage::ActivatePage; // FIXME WTF is this nonsense? virtual void ActivatePage( const SfxItemSet& ) override; void LaunchFillGroup(); @@ -74,7 +72,7 @@ public: bool IsReadOnly() const override; // --------- inherit from the base ------------- - static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet ); + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet ); }; class SfxMacroAssignDlg : public SfxSingleTabDialogController diff --git a/cui/source/inc/macropg.hxx b/cui/source/inc/macropg.hxx index 8cb4e5466b19..145463fadea5 100644 --- a/cui/source/inc/macropg.hxx +++ b/cui/source/inc/macropg.hxx @@ -79,7 +79,6 @@ protected: public: virtual ~SvxMacroTabPage_() override; - virtual void dispose() override; void InitResources(); void InitAndSetHandler( const css::uno::Reference< css::container::XNameReplace >& xAppEvents, const css::uno::Reference< css::container::XNameReplace >& xDocEvents, const css::uno::Reference< css::util::XModifiable >& xModifiable ); diff --git a/cui/source/inc/measure.hxx b/cui/source/inc/measure.hxx index 9cca6a37199f..58a38e822f2b 100644 --- a/cui/source/inc/measure.hxx +++ b/cui/source/inc/measure.hxx @@ -69,9 +69,8 @@ public: SvxMeasurePage(TabPageParent pWindow, const SfxItemSet& rInAttrs); virtual ~SvxMeasurePage() override; - virtual void dispose() override; - static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); + static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); static const sal_uInt16* GetRanges() { return pRanges; } virtual bool FillItemSet( SfxItemSet* ) override; diff --git a/cui/source/inc/numfmt.hxx b/cui/source/inc/numfmt.hxx index cbce3ffbb1b1..b822cd369f9b 100644 --- a/cui/source/inc/numfmt.hxx +++ b/cui/source/inc/numfmt.hxx @@ -57,16 +57,13 @@ public: class SvxNumberFormatTabPage : public SfxTabPage { - friend class VclPtr<SvxNumberFormatTabPage>; - using SfxTabPage::DeactivatePage; static const sal_uInt16 pRanges[]; public: - virtual ~SvxNumberFormatTabPage() override; - virtual void dispose() override; - - static VclPtr<SfxTabPage> Create( TabPageParent pParent, + SvxNumberFormatTabPage(TabPageParent pParent, const SfxItemSet& rCoreAttrs); + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet ); + virtual ~SvxNumberFormatTabPage() override; // Returns area information. static const sal_uInt16* GetRanges() { return pRanges; } @@ -76,9 +73,8 @@ public: void HideLanguage(bool bFlag=true); virtual void PageCreated(const SfxAllItemSet& aSet) override; -private: - SvxNumberFormatTabPage(TabPageParent pParent, const SfxItemSet& rCoreAttrs); +private: std::unique_ptr<SvxNumberInfoItem> pNumItem; std::unique_ptr<SvxNumberFormatShell> pNumFmtShell; sal_uLong nInitFormat; diff --git a/cui/source/inc/numpages.hxx b/cui/source/inc/numpages.hxx index 391094109005..fffe71e4dee4 100644 --- a/cui/source/inc/numpages.hxx +++ b/cui/source/inc/numpages.hxx @@ -57,9 +57,6 @@ typedef std::vector<std::unique_ptr<SvxNumSettings_Impl> > SvxNumSettingsArr_Imp class SvxSingleNumPickTabPage final : public SfxTabPage { - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - SvxNumSettingsArr_Impl aNumSettingsArr; std::unique_ptr<SvxNumRule> pActNum; std::unique_ptr<SvxNumRule> pSaveNum; @@ -78,9 +75,8 @@ class SvxSingleNumPickTabPage final : public SfxTabPage public: SvxSingleNumPickTabPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SvxSingleNumPickTabPage() override; - virtual void dispose() override; - static VclPtr<SfxTabPage> Create( TabPageParent pParent, + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet); virtual void ActivatePage(const SfxItemSet& rSet) override; @@ -91,9 +87,6 @@ public: class SvxBulletPickTabPage final : public SfxTabPage { - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - std::unique_ptr<SvxNumRule> pActNum; std::unique_ptr<SvxNumRule> pSaveNum; sal_uInt16 nActNumLvl; @@ -111,9 +104,8 @@ class SvxBulletPickTabPage final : public SfxTabPage public: SvxBulletPickTabPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SvxBulletPickTabPage() override; - virtual void dispose() override; - static VclPtr<SfxTabPage> Create( TabPageParent pParent, + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet); virtual void ActivatePage(const SfxItemSet& rSet) override; @@ -129,9 +121,6 @@ public: /// TabPage for complete numeration class SvxNumPickTabPage final : public SfxTabPage { - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - OUString sNumCharFmtName; OUString sBulletCharFormatName; @@ -153,9 +142,8 @@ class SvxNumPickTabPage final : public SfxTabPage public: SvxNumPickTabPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SvxNumPickTabPage() override; - virtual void dispose() override; - static VclPtr<SfxTabPage> Create( TabPageParent pParent, + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet); virtual void ActivatePage(const SfxItemSet& rSet) override; @@ -171,9 +159,6 @@ public: class SvxBitmapPickTabPage final : public SfxTabPage { - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - std::vector<OUString> aGrfNames; std::unique_ptr<SvxNumRule> pActNum; @@ -196,9 +181,8 @@ class SvxBitmapPickTabPage final : public SfxTabPage public: SvxBitmapPickTabPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SvxBitmapPickTabPage() override; - virtual void dispose() override; - static VclPtr<SfxTabPage> Create(TabPageParent pParent, + static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet); virtual void ActivatePage(const SfxItemSet& rSet) override; @@ -209,9 +193,6 @@ public: class SvxNumOptionsTabPage : public SfxTabPage { - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - OUString m_sNumCharFmtName; OUString m_sBulletCharFormatName; @@ -300,9 +281,8 @@ class SvxNumOptionsTabPage : public SfxTabPage public: SvxNumOptionsTabPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SvxNumOptionsTabPage() override; - virtual void dispose() override; - static VclPtr<SfxTabPage> Create( TabPageParent pParent, + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet); virtual void ActivatePage(const SfxItemSet& rSet) override; @@ -324,9 +304,6 @@ public: class SvxNumPositionTabPage : public SfxTabPage { - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - std::unique_ptr<SvxNumRule> pActNum; std::unique_ptr<SvxNumRule> pSaveNum; @@ -389,14 +366,13 @@ class SvxNumPositionTabPage : public SfxTabPage public: SvxNumPositionTabPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SvxNumPositionTabPage() override; - virtual void dispose() override; virtual void ActivatePage(const SfxItemSet& rSet) override; virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override; virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; - static VclPtr<SfxTabPage> Create( TabPageParent pParent, + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet); void SetMetric(FieldUnit eSet); diff --git a/cui/source/inc/optasian.hxx b/cui/source/inc/optasian.hxx index 1aaeafa583df..ab38e033811a 100644 --- a/cui/source/inc/optasian.hxx +++ b/cui/source/inc/optasian.hxx @@ -50,7 +50,7 @@ public: SvxAsianLayoutPage(TabPageParent pParent, const SfxItemSet& rSet ); virtual ~SvxAsianLayoutPage() override; - static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet ); + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet ); static const sal_uInt16* GetRanges(); virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; diff --git a/cui/source/inc/optlingu.hxx b/cui/source/inc/optlingu.hxx index b214115ddb0d..e0740cf8602a 100644 --- a/cui/source/inc/optlingu.hxx +++ b/cui/source/inc/optlingu.hxx @@ -79,7 +79,6 @@ public: class SvxLinguTabPage : public SfxTabPage { - friend class VclPtr<SvxLinguTabPage>; private: OUString sCapitalWords; OUString sWordsWithDigits; @@ -119,8 +118,6 @@ private: std::unique_ptr<weld::Button> m_xLinguOptionsEditPB; std::unique_ptr<weld::LinkButton> m_xMoreDictsLink; - SvxLinguTabPage(TabPageParent pParent, const SfxItemSet& rCoreSet); - void AddDicBoxEntry( const css::uno::Reference< css::linguistic2::XDictionary > &rxDic, sal_uInt16 nIdx ); static sal_uInt32 GetDicUserData( const css::uno::Reference< css::linguistic2::XDictionary > &rxDic, sal_uInt16 nIdx ); @@ -136,9 +133,9 @@ private: void UpdateDicBox_Impl(); public: - virtual ~SvxLinguTabPage() override; - virtual void dispose() override; - static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); + SvxLinguTabPage(TabPageParent pParent, const SfxItemSet& rCoreSet); + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); + virtual ~SvxLinguTabPage() override; virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; diff --git a/cui/source/inc/optpath.hxx b/cui/source/inc/optpath.hxx index 1082f1354f85..7dd36f6b47ab 100644 --- a/cui/source/inc/optpath.hxx +++ b/cui/source/inc/optpath.hxx @@ -59,11 +59,9 @@ private: public: SvxPathTabPage( TabPageParent pParent, const SfxItemSet& rSet ); - virtual void dispose() override; + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); virtual ~SvxPathTabPage() override; - static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); - virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; }; diff --git a/cui/source/inc/page.hxx b/cui/source/inc/page.hxx index a52ca0cffc53..3448d8572202 100644 --- a/cui/source/inc/page.hxx +++ b/cui/source/inc/page.hxx @@ -64,10 +64,6 @@ typedef sal_uInt16 MarginPosition; class SvxPageDescPage : public SfxTabPage { - friend class VclPtr<SvxPageDescPage>; - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - static const sal_uInt16 pRanges[]; private: OUString sStandardRegister; @@ -160,14 +156,15 @@ private: void CheckMarginEdits( bool _bClear ); bool IsMarginOutOfRange() const; - SvxPageDescPage(TabPageParent pParent, const SfxItemSet& rSet); - protected: virtual void ActivatePage( const SfxItemSet& rSet ) override; virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; public: - static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); + SvxPageDescPage(TabPageParent pParent, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); + virtual ~SvxPageDescPage() override; + // returns the range of the Which values static const sal_uInt16* GetRanges() { return pRanges; } @@ -175,9 +172,6 @@ public: virtual void Reset( const SfxItemSet* rSet ) override; virtual void FillUserData() override; - virtual ~SvxPageDescPage() override; - virtual void dispose() override; - void SetPaperFormatRanges( Paper eStart ) { ePaperStart = eStart; } diff --git a/cui/source/inc/paragrph.hxx b/cui/source/inc/paragrph.hxx index 35a9bea4b30c..3df98a5bed07 100644 --- a/cui/source/inc/paragrph.hxx +++ b/cui/source/inc/paragrph.hxx @@ -41,14 +41,9 @@ class SvxLineSpacingItem; class SvxStdParagraphTabPage: public SfxTabPage { - friend class VclPtr<SvxStdParagraphTabPage>; - using TabPage::ActivatePage; - using TabPage::DeactivatePage; static const sal_uInt16 pStdRanges[]; private: - SvxStdParagraphTabPage(TabPageParent pParent, const SfxItemSet& rSet); - long nWidth; long nMinFixDist; bool bRelativeMode; @@ -103,11 +98,12 @@ protected: public: + SvxStdParagraphTabPage(TabPageParent pParent, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); virtual ~SvxStdParagraphTabPage() override; DECL_LINK(ELRLoseFocusHdl, weld::MetricSpinButton&, void); - static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); static const sal_uInt16* GetRanges() { return pStdRanges; } virtual bool FillItemSet( SfxItemSet* rSet ) override; @@ -127,9 +123,6 @@ public: class SvxParaAlignTabPage : public SfxTabPage { - friend class VclPtr<SvxParaAlignTabPage>; - using TabPage::ActivatePage; - using TabPage::DeactivatePage; static const sal_uInt16 pAlignRanges[]; SvxParaPrevWindow m_aExampleWin; @@ -163,16 +156,15 @@ class SvxParaAlignTabPage : public SfxTabPage void UpdateExample_Impl(); - SvxParaAlignTabPage(TabPageParent pParent, const SfxItemSet& rSet); - protected: virtual void ActivatePage( const SfxItemSet& rSet ) override; virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; public: + SvxParaAlignTabPage(TabPageParent pParent, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); virtual ~SvxParaAlignTabPage() override; - static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); static const sal_uInt16* GetRanges() { return pAlignRanges; } virtual bool FillItemSet( SfxItemSet* rSet ) override; @@ -199,15 +191,14 @@ public: class SvxExtParagraphTabPage: public SfxTabPage { - friend class VclPtr<SvxExtParagraphTabPage>; - using TabPage::DeactivatePage; static const sal_uInt16 pExtRanges[]; public: + SvxExtParagraphTabPage(TabPageParent pParent, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, + const SfxItemSet* rSet ); virtual ~SvxExtParagraphTabPage() override; - static VclPtr<SfxTabPage> Create( TabPageParent pParent, - const SfxItemSet* rSet ); static const sal_uInt16* GetRanges() { return pExtRanges; } virtual bool FillItemSet( SfxItemSet* rSet ) override; @@ -220,8 +211,6 @@ protected: virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; private: - SvxExtParagraphTabPage(TabPageParent pParent, const SfxItemSet& rSet); - weld::TriStateEnabled aHyphenState; weld::TriStateEnabled aPageBreakState; weld::TriStateEnabled aApplyCollState; @@ -292,24 +281,20 @@ private: class SvxAsianTabPage : public SfxTabPage { - friend class VclPtr<SvxAsianTabPage>; - std::unique_ptr<weld::CheckButton> m_xForbiddenRulesCB; std::unique_ptr<weld::CheckButton> m_xHangingPunctCB; std::unique_ptr<weld::CheckButton> m_xScriptSpaceCB; - SvxAsianTabPage(TabPageParent pParent, const SfxItemSet& rSet); - public: + SvxAsianTabPage(TabPageParent pParent, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet); virtual ~SvxAsianTabPage() override; - static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet); static const sal_uInt16* GetRanges(); virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; virtual void ChangesApplied() override; - }; #endif // INCLUDED_CUI_SOURCE_INC_PARAGRPH_HXX diff --git a/cui/source/inc/swpossizetabpage.hxx b/cui/source/inc/swpossizetabpage.hxx index 4f5c276a6714..d02d915a3b6e 100644 --- a/cui/source/inc/swpossizetabpage.hxx +++ b/cui/source/inc/swpossizetabpage.hxx @@ -31,8 +31,6 @@ enum class SvxAnchorIds; class SvxSwPosSizeTabPage : public SfxTabPage { - using TabPage::DeactivatePage; - Link<SvxSwFrameValidation&,void> m_aValidateLink; ::tools::Rectangle m_aRect; //size of all selected objects @@ -112,10 +110,9 @@ class SvxSwPosSizeTabPage : public SfxTabPage public: SvxSwPosSizeTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); - virtual void dispose() override; + static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); virtual ~SvxSwPosSizeTabPage() override; - static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); static const sal_uInt16* GetRanges(); virtual bool FillItemSet( SfxItemSet* ) override; diff --git a/cui/source/inc/tabstpge.hxx b/cui/source/inc/tabstpge.hxx index a0c8e7ce7b5d..38c95d2f52ce 100644 --- a/cui/source/inc/tabstpge.hxx +++ b/cui/source/inc/tabstpge.hxx @@ -59,14 +59,13 @@ public: class SvxTabulatorTabPage : public SfxTabPage { - friend class VclPtr<SvxTabulatorTabPage>; - using TabPage::DeactivatePage; static const sal_uInt16 pRanges[]; public: + SvxTabulatorTabPage(TabPageParent pParent, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); virtual ~SvxTabulatorTabPage() override; - virtual void dispose() override; - static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); + static const sal_uInt16* GetRanges() { return pRanges; } virtual bool FillItemSet( SfxItemSet* rSet ) override; @@ -78,8 +77,6 @@ protected: virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; private: - SvxTabulatorTabPage(TabPageParent pParent, const SfxItemSet& rSet); - // local variables, internal functions SvxTabStop aCurrentTab; std::unique_ptr<SvxTabStopItem> aNewTabs; diff --git a/cui/source/inc/textanim.hxx b/cui/source/inc/textanim.hxx index ecc725edcb7b..b5b2ae409e1e 100644 --- a/cui/source/inc/textanim.hxx +++ b/cui/source/inc/textanim.hxx @@ -81,7 +81,7 @@ public: SvxTextAnimationPage(TabPageParent pPage, const SfxItemSet& rInAttrs); virtual ~SvxTextAnimationPage() override; - static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); + static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); static const sal_uInt16* GetRanges() { return pRanges; } virtual bool FillItemSet( SfxItemSet* ) override; diff --git a/cui/source/inc/textattr.hxx b/cui/source/inc/textattr.hxx index 42b998ae7b32..0cc80c9e64ff 100644 --- a/cui/source/inc/textattr.hxx +++ b/cui/source/inc/textattr.hxx @@ -77,7 +77,7 @@ public: SvxTextAttrPage(TabPageParent pWindow, const SfxItemSet& rInAttrs); virtual ~SvxTextAttrPage() override; - static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); + static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); static const sal_uInt16* GetRanges() { return pRanges; } virtual bool FillItemSet( SfxItemSet* ) override; diff --git a/cui/source/inc/transfrm.hxx b/cui/source/inc/transfrm.hxx index 0d7b6fe5a75b..f90b7318534a 100644 --- a/cui/source/inc/transfrm.hxx +++ b/cui/source/inc/transfrm.hxx @@ -61,8 +61,6 @@ public: class SvxPositionSizeTabPage : public SvxTabPage { - using TabPage::ActivatePage; - using TabPage::DeactivatePage; static const sal_uInt16 pPosSizeRanges[]; private: @@ -134,7 +132,7 @@ public: SvxPositionSizeTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); virtual ~SvxPositionSizeTabPage() override; - static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); + static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); static const sal_uInt16* GetRanges() { return pPosSizeRanges; } virtual bool FillItemSet( SfxItemSet* ) override; @@ -163,8 +161,6 @@ public: \************************************************************************/ class SvxAngleTabPage : public SvxTabPage { - using TabPage::ActivatePage; - using TabPage::DeactivatePage; static const sal_uInt16 pAngleRanges[]; private: @@ -193,7 +189,7 @@ public: SvxAngleTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); virtual ~SvxAngleTabPage() override; - static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); + static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); static const sal_uInt16* GetRanges() { return pAngleRanges; } virtual bool FillItemSet( SfxItemSet* ) override; @@ -215,8 +211,6 @@ public: \************************************************************************/ class SvxSlantTabPage : public SfxTabPage { - using TabPage::ActivatePage; - using TabPage::DeactivatePage; static const sal_uInt16 pSlantRanges[]; private: @@ -241,7 +235,7 @@ public: SvxSlantTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs); virtual ~SvxSlantTabPage() override; - static VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); + static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* ); static const sal_uInt16* GetRanges() { return pSlantRanges; } virtual bool FillItemSet( SfxItemSet* ) override; diff --git a/cui/source/options/connpooloptions.cxx b/cui/source/options/connpooloptions.cxx index 139bd2b1f8ae..6f6449b52be0 100644 --- a/cui/source/options/connpooloptions.cxx +++ b/cui/source/options/connpooloptions.cxx @@ -125,9 +125,9 @@ namespace offapp { } - VclPtr<SfxTabPage> ConnectionPoolOptionsPage::Create(TabPageParent pParent, const SfxItemSet* _rAttrSet) + std::unique_ptr<SfxTabPage> ConnectionPoolOptionsPage::Create(TabPageParent pParent, const SfxItemSet* _rAttrSet) { - return VclPtr<ConnectionPoolOptionsPage>::Create(pParent, *_rAttrSet); + return std::make_unique<ConnectionPoolOptionsPage>(pParent, *_rAttrSet); } void ConnectionPoolOptionsPage::implInitControls(const SfxItemSet& _rSet) diff --git a/cui/source/options/connpooloptions.hxx b/cui/source/options/connpooloptions.hxx index 37bb0378d667..41acf9cc453a 100644 --- a/cui/source/options/connpooloptions.hxx +++ b/cui/source/options/connpooloptions.hxx @@ -28,8 +28,6 @@ namespace offapp { class ConnectionPoolOptionsPage final : public SfxTabPage { - using TabPage::ActivatePage; - OUString m_sYes; OUString m_sNo; DriverPoolingSettings m_aSettings; @@ -47,7 +45,7 @@ namespace offapp public: ConnectionPoolOptionsPage(TabPageParent _pParent, const SfxItemSet& _rAttrSet); virtual ~ConnectionPoolOptionsPage() override; - static VclPtr<SfxTabPage> Create(TabPageParent _pParent, const SfxItemSet* _rAttrSet); + static std::unique_ptr<SfxTabPage> Create(TabPageParent _pParent, const SfxItemSet* _rAttrSet); private: virtual bool FillItemSet(SfxItemSet* _rSet) override; diff --git a/cui/source/options/cuisrchdlg.cxx b/cui/source/options/cuisrchdlg.cxx index 25ada3e09410..08682efb1360 100644 --- a/cui/source/options/cuisrchdlg.cxx +++ b/cui/source/options/cuisrchdlg.cxx @@ -33,22 +33,19 @@ SvxJSearchOptionsDialog::SvxJSearchOptionsDialog(weld::Window *pParent, // m_xPage will be implicitly destroyed by the // SfxSingleTabDialog destructor TabPageParent pPageParent(get_content_area(), this); - m_xPage.reset(static_cast<SvxJSearchOptionsPage*>( - SvxJSearchOptionsPage::Create( - pPageParent, &rOptionsSet).get())); - SetTabPage(m_xPage); //! implicitly calls m_xPage->Reset(...)! - m_xPage->EnableSaveOptions(false); - m_xPage->SetTransliterationFlags(nInitialFlags); + SetTabPage(SvxJSearchOptionsPage::Create(pPageParent, &rOptionsSet)); //! implicitly calls m_xPage->Reset(...)! + m_pPage = static_cast<SvxJSearchOptionsPage*>(GetTabPage()); + m_pPage->EnableSaveOptions(false); + m_pPage->SetTransliterationFlags(nInitialFlags); } SvxJSearchOptionsDialog::~SvxJSearchOptionsDialog() { - m_xPage.clear(); } TransliterationFlags SvxJSearchOptionsDialog::GetTransliterationFlags() const { - return m_xPage->GetTransliterationFlags(); + return m_pPage->GetTransliterationFlags(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx index d02b0b118bc2..a58819d3caea 100644 --- a/cui/source/options/dbregister.cxx +++ b/cui/source/options/dbregister.cxx @@ -113,20 +113,14 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage(TabPageParent pParent, cons DbRegistrationOptionsPage::~DbRegistrationOptionsPage() { - disposeOnce(); -} - -void DbRegistrationOptionsPage::dispose() -{ for (int i = 0, nCount = m_xPathBox->n_children(); i < nCount; ++i ) delete reinterpret_cast<DatabaseRegistration*>(m_xPathBox->get_id(i).toInt64()); - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> DbRegistrationOptionsPage::Create( TabPageParent pParent, +std::unique_ptr<SfxTabPage> DbRegistrationOptionsPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<DbRegistrationOptionsPage>::Create( pParent, *rAttrSet ); + return std::make_unique<DbRegistrationOptionsPage>(pParent, *rAttrSet); } bool DbRegistrationOptionsPage::FillItemSet( SfxItemSet* rCoreSet ) diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx index b7ffaeabd6a9..c308dd72d7ad 100644 --- a/cui/source/options/fontsubs.cxx +++ b/cui/source/options/fontsubs.cxx @@ -140,10 +140,10 @@ SvxFontSubstTabPage::~SvxFontSubstTabPage() { } -VclPtr<SfxTabPage> SvxFontSubstTabPage::Create( TabPageParent pParent, +std::unique_ptr<SfxTabPage> SvxFontSubstTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SvxFontSubstTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SvxFontSubstTabPage>(pParent, *rAttrSet); } bool SvxFontSubstTabPage::FillItemSet( SfxItemSet* ) diff --git a/cui/source/options/fontsubs.hxx b/cui/source/options/fontsubs.hxx index 4f33ab24525e..a250a80c8bfa 100644 --- a/cui/source/options/fontsubs.hxx +++ b/cui/source/options/fontsubs.hxx @@ -49,11 +49,10 @@ class SvxFontSubstTabPage : public SfxTabPage void CheckEnable(); void setColSizes(); - virtual ~SvxFontSubstTabPage() override; - public: SvxFontSubstTabPage(TabPageParent pParent, const SfxItemSet& rSet); - static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet); + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet); + virtual ~SvxFontSubstTabPage() override; virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; }; diff --git a/cui/source/options/optaccessibility.cxx b/cui/source/options/optaccessibility.cxx index 47b44435e3f9..a251ea81ce94 100644 --- a/cui/source/options/optaccessibility.cxx +++ b/cui/source/options/optaccessibility.cxx @@ -43,9 +43,9 @@ SvxAccessibilityOptionsTabPage::~SvxAccessibilityOptionsTabPage() { } -VclPtr<SfxTabPage> SvxAccessibilityOptionsTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) +std::unique_ptr<SfxTabPage> SvxAccessibilityOptionsTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SvxAccessibilityOptionsTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SvxAccessibilityOptionsTabPage>(pParent, *rAttrSet); } bool SvxAccessibilityOptionsTabPage::FillItemSet( SfxItemSet* ) diff --git a/cui/source/options/optaccessibility.hxx b/cui/source/options/optaccessibility.hxx index 5a1ed1bbb3c2..5f00ec328b50 100644 --- a/cui/source/options/optaccessibility.hxx +++ b/cui/source/options/optaccessibility.hxx @@ -35,7 +35,7 @@ public: SvxAccessibilityOptionsTabPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SvxAccessibilityOptionsTabPage() 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/cui/source/options/optasian.cxx b/cui/source/options/optasian.cxx index ef167d231950..2b053e30998a 100644 --- a/cui/source/options/optasian.cxx +++ b/cui/source/options/optasian.cxx @@ -131,9 +131,9 @@ SvxAsianLayoutPage::~SvxAsianLayoutPage() { } -VclPtr<SfxTabPage> SvxAsianLayoutPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) +std::unique_ptr<SfxTabPage> SvxAsianLayoutPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SvxAsianLayoutPage>::Create(pParent, *rAttrSet); + return std::make_unique<SvxAsianLayoutPage>(pParent, *rAttrSet); } bool SvxAsianLayoutPage::FillItemSet( SfxItemSet* ) diff --git a/cui/source/options/optbasic.cxx b/cui/source/options/optbasic.cxx index 328d3261e524..4563ed3887a6 100644 --- a/cui/source/options/optbasic.cxx +++ b/cui/source/options/optbasic.cxx @@ -118,9 +118,9 @@ void SvxBasicIDEOptionsPage::Reset( const SfxItemSet* /*rSet*/ ) m_xUseExtendedTypesChk->save_state(); } -VclPtr<SfxTabPage> SvxBasicIDEOptionsPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) +std::unique_ptr<SfxTabPage> SvxBasicIDEOptionsPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<SvxBasicIDEOptionsPage>::Create( pParent, *rAttrSet ); + return std::make_unique<SvxBasicIDEOptionsPage>( pParent, *rAttrSet ); } void SvxBasicIDEOptionsPage::FillUserData() diff --git a/cui/source/options/optbasic.hxx b/cui/source/options/optbasic.hxx index 5114e8c8a631..63f2fed9b299 100644 --- a/cui/source/options/optbasic.hxx +++ b/cui/source/options/optbasic.hxx @@ -38,7 +38,7 @@ public: SvxBasicIDEOptionsPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SvxBasicIDEOptionsPage() 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* rSet ) override; virtual void FillUserData() override; diff --git a/cui/source/options/optchart.cxx b/cui/source/options/optchart.cxx index 116ff56a9473..2f6938101f85 100644 --- a/cui/source/options/optchart.cxx +++ b/cui/source/options/optchart.cxx @@ -129,14 +129,8 @@ SvxDefaultColorOptPage::SvxDefaultColorOptPage(TabPageParent pParent, const SfxI SvxDefaultColorOptPage::~SvxDefaultColorOptPage() { - disposeOnce(); -} - -void SvxDefaultColorOptPage::dispose() -{ m_xValSetColorBoxWin.reset(); m_xValSetColorBox.reset(); - SfxTabPage::dispose(); } void SvxDefaultColorOptPage::Construct() @@ -147,9 +141,9 @@ void SvxDefaultColorOptPage::Construct() m_xLbChartColors->select( 0 ); } -VclPtr<SfxTabPage> SvxDefaultColorOptPage::Create( TabPageParent pParent, const SfxItemSet* rAttrs ) +std::unique_ptr<SfxTabPage> SvxDefaultColorOptPage::Create( TabPageParent pParent, const SfxItemSet* rAttrs ) { - return VclPtr<SvxDefaultColorOptPage>::Create( pParent, *rAttrs ); + return std::make_unique<SvxDefaultColorOptPage>( pParent, *rAttrs ); } bool SvxDefaultColorOptPage::FillItemSet( SfxItemSet* rOutAttrs ) diff --git a/cui/source/options/optchart.hxx b/cui/source/options/optchart.hxx index fca6bec2be5e..8a0da42f3b66 100644 --- a/cui/source/options/optchart.hxx +++ b/cui/source/options/optchart.hxx @@ -67,11 +67,10 @@ private: public: SvxDefaultColorOptPage(TabPageParent pParent, const SfxItemSet& rInAttrs); virtual ~SvxDefaultColorOptPage() override; - virtual void dispose() override; void Construct(); - static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rInAttrs ); + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rInAttrs ); virtual bool FillItemSet( SfxItemSet* rOutAttrs ) override; virtual void Reset( const SfxItemSet* rInAttrs ) override; diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx index 39317f098233..828ecfd3c481 100644 --- a/cui/source/options/optcolor.cxx +++ b/cui/source/options/optcolor.cxx @@ -719,11 +719,6 @@ SvxColorOptionsTabPage::SvxColorOptionsTabPage(TabPageParent pParent, const SfxI SvxColorOptionsTabPage::~SvxColorOptionsTabPage() { - disposeOnce(); -} - -void SvxColorOptionsTabPage::dispose() -{ if (pColorConfig) { //when the dialog is cancelled but the color scheme ListBox has been changed these @@ -746,12 +741,11 @@ void SvxColorOptionsTabPage::dispose() pExtColorConfig.reset(); } m_xColorConfigCT.reset(); - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> SvxColorOptionsTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) +std::unique_ptr<SfxTabPage> SvxColorOptionsTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SvxColorOptionsTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SvxColorOptionsTabPage>(pParent, *rAttrSet); } bool SvxColorOptionsTabPage::FillItemSet( SfxItemSet* ) diff --git a/cui/source/options/optcolor.hxx b/cui/source/options/optcolor.hxx index 497a4f4060e8..a3b6349d75b8 100644 --- a/cui/source/options/optcolor.hxx +++ b/cui/source/options/optcolor.hxx @@ -26,8 +26,6 @@ class ColorConfigCtrl_Impl; class AbstractSvxNameDialog; class SvxColorOptionsTabPage : public SfxTabPage { - using SfxTabPage::DeactivatePage; - bool bFillItemSetCalled; std::unique_ptr<weld::ComboBox> m_xColorSchemeLB; @@ -52,10 +50,9 @@ class SvxColorOptionsTabPage : public SfxTabPage public: SvxColorOptionsTabPage(TabPageParent pParent, const SfxItemSet& rSet); - virtual void dispose() override; virtual ~SvxColorOptionsTabPage() 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/cui/source/options/optctl.cxx b/cui/source/options/optctl.cxx index e9e88d28d417..35a207bc9f54 100644 --- a/cui/source/options/optctl.cxx +++ b/cui/source/options/optctl.cxx @@ -53,9 +53,9 @@ SvxCTLOptionsPage::~SvxCTLOptionsPage() { } -VclPtr<SfxTabPage> SvxCTLOptionsPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) +std::unique_ptr<SfxTabPage> SvxCTLOptionsPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<SvxCTLOptionsPage>::Create( pParent, *rAttrSet ); + return std::make_unique<SvxCTLOptionsPage>( pParent, *rAttrSet ); } bool SvxCTLOptionsPage::FillItemSet( SfxItemSet* ) diff --git a/cui/source/options/optctl.hxx b/cui/source/options/optctl.hxx index 54dc5f7f6661..f92cbcdb3db3 100644 --- a/cui/source/options/optctl.hxx +++ b/cui/source/options/optctl.hxx @@ -38,7 +38,7 @@ private: public: SvxCTLOptionsPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SvxCTLOptionsPage() 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/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx index 5d35c0777e62..0a07a4bc83fd 100644 --- a/cui/source/options/optfltr.cxx +++ b/cui/source/options/optfltr.cxx @@ -65,10 +65,10 @@ IMPL_LINK_NOARG(OfaMSFilterTabPage, LoadExcelBasicCheckHdl_Impl, weld::Button&, m_xEBasicExectblCB->set_sensitive(m_xEBasicCodeCB->get_active()); } -VclPtr<SfxTabPage> OfaMSFilterTabPage::Create( TabPageParent pParent, +std::unique_ptr<SfxTabPage> OfaMSFilterTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<OfaMSFilterTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<OfaMSFilterTabPage>(pParent, *rAttrSet); } bool OfaMSFilterTabPage::FillItemSet( SfxItemSet* ) @@ -147,10 +147,10 @@ OfaMSFilterTabPage2::~OfaMSFilterTabPage2() { } -VclPtr<SfxTabPage> OfaMSFilterTabPage2::Create( TabPageParent pParent, +std::unique_ptr<SfxTabPage> OfaMSFilterTabPage2::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<OfaMSFilterTabPage2>::Create( pParent, *rAttrSet ); + return std::make_unique<OfaMSFilterTabPage2>( pParent, *rAttrSet ); } bool OfaMSFilterTabPage2::FillItemSet( SfxItemSet* ) diff --git a/cui/source/options/optfltr.hxx b/cui/source/options/optfltr.hxx index e619ecc8b3e3..a4e9edd88214 100644 --- a/cui/source/options/optfltr.hxx +++ b/cui/source/options/optfltr.hxx @@ -38,7 +38,7 @@ public: OfaMSFilterTabPage(TabPageParent pParent, const SfxItemSet& rSet ); virtual ~OfaMSFilterTabPage() override; - static VclPtr<SfxTabPage> Create( TabPageParent pParent, + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet ); virtual bool FillItemSet( SfxItemSet* rSet ) override; @@ -62,8 +62,6 @@ class OfaMSFilterTabPage2 : public SfxTabPage std::unique_ptr<weld::RadioButton> m_xShadingRB; std::unique_ptr<weld::CheckButton> m_xMSOLockFileCB; - virtual ~OfaMSFilterTabPage2() override; - void InsertEntry( const OUString& _rTxt, MSFltrPg2_CheckBoxEntries _nType ); void InsertEntry( const OUString& _rTxt, MSFltrPg2_CheckBoxEntries _nType, bool saveEnabled ); @@ -71,7 +69,8 @@ class OfaMSFilterTabPage2 : public SfxTabPage public: OfaMSFilterTabPage2(TabPageParent pParent, const SfxItemSet& rSet); - static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet ); + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet ); + virtual ~OfaMSFilterTabPage2() override; virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index ff1e2a7bf245..2568d901464e 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -283,9 +283,9 @@ OfaMiscTabPage::~OfaMiscTabPage() { } -VclPtr<SfxTabPage> OfaMiscTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) +std::unique_ptr<SfxTabPage> OfaMiscTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<OfaMiscTabPage>::Create( pParent, *rAttrSet ); + return std::make_unique<OfaMiscTabPage>( pParent, *rAttrSet ); } bool OfaMiscTabPage::FillItemSet( SfxItemSet* rSet ) @@ -704,9 +704,9 @@ IMPL_LINK_NOARG(OfaViewTabPage, OnForceOpenGLToggled, weld::ToggleButton&, void) } } -VclPtr<SfxTabPage> OfaViewTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) +std::unique_ptr<SfxTabPage> OfaViewTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<OfaViewTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<OfaViewTabPage>(pParent, *rAttrSet); } bool OfaViewTabPage::FillItemSet( SfxItemSet* ) @@ -1238,9 +1238,9 @@ OfaLanguagesTabPage::~OfaLanguagesTabPage() { } -VclPtr<SfxTabPage> OfaLanguagesTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) +std::unique_ptr<SfxTabPage> OfaLanguagesTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<OfaLanguagesTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<OfaLanguagesTabPage>(pParent, *rAttrSet); } static void lcl_Update(std::unique_ptr<SfxVoidItem> pInvalidItems[], std::unique_ptr<SfxBoolItem> pBoolItems[], sal_uInt16 nCount) diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx index b1256225a660..e32b65eaeac1 100644 --- a/cui/source/options/optgdlg.hxx +++ b/cui/source/options/optgdlg.hxx @@ -35,7 +35,6 @@ namespace svt { class OfaMiscTabPage : public SfxTabPage { - using TabPage::DeactivatePage; private: OUString m_aStrDateInfo; @@ -64,7 +63,7 @@ public: OfaMiscTabPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~OfaMiscTabPage() 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; @@ -122,7 +121,7 @@ public: OfaViewTabPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~OfaViewTabPage() 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; @@ -168,7 +167,7 @@ public: OfaLanguagesTabPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~OfaLanguagesTabPage() 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/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx index 39bc71e8cc23..55068ffcad0d 100644 --- a/cui/source/options/optgenrl.cxx +++ b/cui/source/options/optgenrl.cxx @@ -228,7 +228,6 @@ SvxGeneralTabPage::SvxGeneralTabPage(TabPageParent pParent, const SfxItemSet& rC SvxGeneralTabPage::~SvxGeneralTabPage() { - disposeOnce(); } // Initializes the titles and the edit boxes, @@ -337,9 +336,9 @@ void SvxGeneralTabPage::SetLinks () } -VclPtr<SfxTabPage> SvxGeneralTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) +std::unique_ptr<SfxTabPage> SvxGeneralTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<SvxGeneralTabPage>::Create( pParent, *rAttrSet ); + return std::make_unique<SvxGeneralTabPage>( pParent, *rAttrSet ); } bool SvxGeneralTabPage::FillItemSet( SfxItemSet* ) diff --git a/cui/source/options/opthtml.cxx b/cui/source/options/opthtml.cxx index 15edb46806a3..8b8c07c26f86 100644 --- a/cui/source/options/opthtml.cxx +++ b/cui/source/options/opthtml.cxx @@ -64,10 +64,10 @@ OfaHtmlTabPage::~OfaHtmlTabPage() { } -VclPtr<SfxTabPage> OfaHtmlTabPage::Create( TabPageParent pParent, +std::unique_ptr<SfxTabPage> OfaHtmlTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<OfaHtmlTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<OfaHtmlTabPage>(pParent, *rAttrSet); } bool OfaHtmlTabPage::FillItemSet( SfxItemSet* ) diff --git a/cui/source/options/opthtml.hxx b/cui/source/options/opthtml.hxx index e815f073376b..f0b26e7b3e08 100644 --- a/cui/source/options/opthtml.hxx +++ b/cui/source/options/opthtml.hxx @@ -48,7 +48,7 @@ class OfaHtmlTabPage : public SfxTabPage public: OfaHtmlTabPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~OfaHtmlTabPage() override; - static VclPtr<SfxTabPage> Create( TabPageParent pParent, + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet ); virtual bool FillItemSet( SfxItemSet* rSet ) override; diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index 53fc71f2a69d..71df2eda60f1 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -185,9 +185,9 @@ SvxProxyTabPage::~SvxProxyTabPage() { } -VclPtr<SfxTabPage> SvxProxyTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet ) +std::unique_ptr<SfxTabPage> SvxProxyTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<SvxProxyTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SvxProxyTabPage>(pParent, *rAttrSet); } void SvxProxyTabPage::ReadConfigData_Impl() @@ -786,9 +786,9 @@ void SvxSecurityTabPage::InitControls() } } -VclPtr<SfxTabPage> SvxSecurityTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet ) +std::unique_ptr<SfxTabPage> SvxSecurityTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<SvxSecurityTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SvxSecurityTabPage>(pParent, *rAttrSet); } void SvxSecurityTabPage::ActivatePage( const SfxItemSet& ) @@ -888,9 +888,9 @@ SvxEMailTabPage::~SvxEMailTabPage() /* -------------------------------------------------------------------------*/ -VclPtr<SfxTabPage> SvxEMailTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) +std::unique_ptr<SfxTabPage> SvxEMailTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<SvxEMailTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SvxEMailTabPage>(pParent, *rAttrSet); } /* -------------------------------------------------------------------------*/ diff --git a/cui/source/options/optinet2.hxx b/cui/source/options/optinet2.hxx index 44e9be04332a..1abc8a0a9985 100644 --- a/cui/source/options/optinet2.hxx +++ b/cui/source/options/optinet2.hxx @@ -68,7 +68,7 @@ private: public: SvxProxyTabPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SvxProxyTabPage() 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; }; @@ -79,9 +79,6 @@ class SvtSecurityOptions; class CertPathDialog; class SvxSecurityTabPage : public SfxTabPage { - using TabPage::ActivatePage; - using TabPage::DeactivatePage; - friend class VclPtr<SvxSecurityTabPage>; private: std::unique_ptr<SvtSecurityOptions> mpSecOptions; std::unique_ptr<svx::SecurityOptionsDialog> m_xSecOptDlg; @@ -121,15 +118,14 @@ private: void InitControls(); - SvxSecurityTabPage(TabPageParent pParent, const SfxItemSet& rSet); - virtual ~SvxSecurityTabPage() override; - protected: virtual void ActivatePage( const SfxItemSet& rSet ) override; virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override; public: - static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet ); + SvxSecurityTabPage(TabPageParent pParent, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet ); + virtual ~SvxSecurityTabPage() override; virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; }; @@ -156,7 +152,7 @@ public: SvxEMailTabPage(TabPageParent pParent, const SfxItemSet& rSet ); virtual ~SvxEMailTabPage() 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/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index 676ce162a16b..2e8fccf8e69f 100644 --- a/cui/source/options/optjava.cxx +++ b/cui/source/options/optjava.cxx @@ -129,18 +129,12 @@ SvxJavaOptionsPage::SvxJavaOptionsPage(TabPageParent pParent, const SfxItemSet& SvxJavaOptionsPage::~SvxJavaOptionsPage() { - disposeOnce(); -} - -void SvxJavaOptionsPage::dispose() -{ ClearJavaInfo(); #if HAVE_FEATURE_JAVA m_aAddedInfos.clear(); jfw_unlock(); #endif - SfxTabPage::dispose(); } IMPL_LINK_NOARG(SvxJavaOptionsPage, EnableHdl_Impl, weld::Button&, void) @@ -321,7 +315,6 @@ void SvxJavaOptionsPage::ClearJavaInfo() #endif } - void SvxJavaOptionsPage::ClearJavaList() { m_xJavaList->clear(); @@ -476,9 +469,9 @@ void SvxJavaOptionsPage::RequestRestart(svtools::RestartReason eReason) pParentDlg->SetNeedsRestart(eReason); } -VclPtr<SfxTabPage> SvxJavaOptionsPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) +std::unique_ptr<SfxTabPage> SvxJavaOptionsPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SvxJavaOptionsPage>::Create( pParent, *rAttrSet ); + return std::make_unique<SvxJavaOptionsPage>(pParent, *rAttrSet); } bool SvxJavaOptionsPage::FillItemSet( SfxItemSet* /*rCoreSet*/ ) diff --git a/cui/source/options/optjava.hxx b/cui/source/options/optjava.hxx index ad84b0d1a17c..fec960a5c609 100644 --- a/cui/source/options/optjava.hxx +++ b/cui/source/options/optjava.hxx @@ -108,9 +108,8 @@ private: public: SvxJavaOptionsPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SvxJavaOptionsPage() 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 bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; diff --git a/cui/source/options/optjsearch.cxx b/cui/source/options/optjsearch.cxx index f325ae125abb..b110ad1c9fd6 100644 --- a/cui/source/options/optjsearch.cxx +++ b/cui/source/options/optjsearch.cxx @@ -53,12 +53,11 @@ SvxJSearchOptionsPage::SvxJSearchOptionsPage(TabPageParent pParent, const SfxIte SvxJSearchOptionsPage::~SvxJSearchOptionsPage() { - disposeOnce(); } -VclPtr<SfxTabPage> SvxJSearchOptionsPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> SvxJSearchOptionsPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<SvxJSearchOptionsPage>::Create(pParent, *rSet); + return std::make_unique<SvxJSearchOptionsPage>(pParent, *rSet); } void SvxJSearchOptionsPage::SetTransliterationFlags( TransliterationFlags nSettings ) diff --git a/cui/source/options/optjsearch.hxx b/cui/source/options/optjsearch.hxx index 74164f87f5b0..526b1f430d89 100644 --- a/cui/source/options/optjsearch.hxx +++ b/cui/source/options/optjsearch.hxx @@ -58,7 +58,7 @@ private: public: SvxJSearchOptionsPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SvxJSearchOptionsPage() override; - static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet); + static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet); virtual void Reset( const SfxItemSet* rSet ) override; virtual bool FillItemSet( SfxItemSet* rSet ) override; diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index 8b194bd3f4e3..9f30b60d71f5 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -893,19 +893,13 @@ SvxLinguTabPage::SvxLinguTabPage(TabPageParent pParent, const SfxItemSet& rSet) SvxLinguTabPage::~SvxLinguTabPage() { - disposeOnce(); -} - -void SvxLinguTabPage::dispose() -{ pLinguData.reset(); - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> SvxLinguTabPage::Create( TabPageParent pParent, +std::unique_ptr<SfxTabPage> SvxLinguTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<SvxLinguTabPage>::Create( pParent, *rAttrSet ); + return std::make_unique<SvxLinguTabPage>( pParent, *rAttrSet ); } bool SvxLinguTabPage::FillItemSet( SfxItemSet* rCoreSet ) diff --git a/cui/source/options/optopencl.cxx b/cui/source/options/optopencl.cxx index 8a393d067678..35f726472d40 100644 --- a/cui/source/options/optopencl.cxx +++ b/cui/source/options/optopencl.cxx @@ -45,9 +45,9 @@ SvxOpenCLTabPage::~SvxOpenCLTabPage() { } -VclPtr<SfxTabPage> SvxOpenCLTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) +std::unique_ptr<SfxTabPage> SvxOpenCLTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SvxOpenCLTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SvxOpenCLTabPage>(pParent, *rAttrSet); } bool SvxOpenCLTabPage::FillItemSet( SfxItemSet* ) diff --git a/cui/source/options/optopencl.hxx b/cui/source/options/optopencl.hxx index ddb74e07643a..c9a73531ef71 100644 --- a/cui/source/options/optopencl.hxx +++ b/cui/source/options/optopencl.hxx @@ -34,10 +34,9 @@ private: public: SvxOpenCLTabPage(TabPageParent pParent, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); virtual ~SvxOpenCLTabPage() override; - static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); - virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; }; diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx index f8aeaf58e7f1..5f026366efac 100644 --- a/cui/source/options/optpath.cxx +++ b/cui/source/options/optpath.cxx @@ -201,20 +201,14 @@ SvxPathTabPage::SvxPathTabPage(TabPageParent pParent, const SfxItemSet& rSet) SvxPathTabPage::~SvxPathTabPage() { - disposeOnce(); -} - -void SvxPathTabPage::dispose() -{ for (int i = 0, nEntryCount = m_xPathBox->n_children(); i < nEntryCount; ++i) delete reinterpret_cast<PathUserData_Impl*>(m_xPathBox->get_id(i).toInt64()); - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> SvxPathTabPage::Create( TabPageParent pParent, +std::unique_ptr<SfxTabPage> SvxPathTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<SvxPathTabPage>::Create( pParent, *rAttrSet ); + return std::make_unique<SvxPathTabPage>( pParent, *rAttrSet ); } bool SvxPathTabPage::FillItemSet( SfxItemSet* ) diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx index 65054a4e81fb..14cc52f86a24 100644 --- a/cui/source/options/optsave.cxx +++ b/cui/source/options/optsave.cxx @@ -179,10 +179,10 @@ SvxSaveTabPage::~SvxSaveTabPage() { } -VclPtr<SfxTabPage> SvxSaveTabPage::Create(TabPageParent pParent, +std::unique_ptr<SfxTabPage> SvxSaveTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SvxSaveTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SvxSaveTabPage>(pParent, *rAttrSet); } void SvxSaveTabPage::DetectHiddenControls() diff --git a/cui/source/options/optsave.hxx b/cui/source/options/optsave.hxx index 412adaeb0dbf..fd8b037b0953 100644 --- a/cui/source/options/optsave.hxx +++ b/cui/source/options/optsave.hxx @@ -73,7 +73,7 @@ public: SvxSaveTabPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SvxSaveTabPage() 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/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx index 978a6768b8d6..5d085986faff 100644 --- a/cui/source/options/optupdt.cxx +++ b/cui/source/options/optupdt.cxx @@ -175,10 +175,9 @@ void SvxOnlineUpdateTabPage::UpdateUserAgent() } } -VclPtr<SfxTabPage> -SvxOnlineUpdateTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) +std::unique_ptr<SfxTabPage> SvxOnlineUpdateTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<SvxOnlineUpdateTabPage>::Create( pParent, *rAttrSet ); + return std::make_unique<SvxOnlineUpdateTabPage>( pParent, *rAttrSet ); } bool SvxOnlineUpdateTabPage::FillItemSet( SfxItemSet* ) diff --git a/cui/source/options/optupdt.hxx b/cui/source/options/optupdt.hxx index ff126c416d7a..5c7b3fb20ed3 100644 --- a/cui/source/options/optupdt.hxx +++ b/cui/source/options/optupdt.hxx @@ -59,10 +59,9 @@ private: public: SvxOnlineUpdateTabPage(TabPageParent pParent, const SfxItemSet& rSet); + static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); virtual ~SvxOnlineUpdateTabPage() override; - static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet ); - virtual bool FillItemSet( SfxItemSet* rSet ) override; virtual void Reset( const SfxItemSet* rSet ) override; virtual void FillUserData() override; diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx index 8767c856482a..a3f905106661 100644 --- a/cui/source/options/personalization.cxx +++ b/cui/source/options/personalization.cxx @@ -47,9 +47,10 @@ SvxPersonalizationTabPage::SvxPersonalizationTabPage(TabPageParent pParent, cons SvxPersonalizationTabPage::~SvxPersonalizationTabPage() {} -VclPtr<SfxTabPage> SvxPersonalizationTabPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> SvxPersonalizationTabPage::Create(TabPageParent pParent, + const SfxItemSet* rSet) { - return VclPtr<SvxPersonalizationTabPage>::Create(pParent, *rSet); + return std::make_unique<SvxPersonalizationTabPage>(pParent, *rSet); } bool SvxPersonalizationTabPage::FillItemSet(SfxItemSet*) diff --git a/cui/source/options/personalization.hxx b/cui/source/options/personalization.hxx index 9317041409e0..a045059e92a8 100644 --- a/cui/source/options/personalization.hxx +++ b/cui/source/options/personalization.hxx @@ -17,8 +17,6 @@ class SvxPersonalizationTabPage : public SfxTabPage { - using SfxTabPage::DeactivatePage; - private: std::unique_ptr<weld::RadioButton> m_xNoPersona; ///< Just the default look, without any bitmap std::unique_ptr<weld::RadioButton> m_xDefaultPersona; ///< Use the built-in bitmap @@ -32,7 +30,7 @@ public: SvxPersonalizationTabPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SvxPersonalizationTabPage() override; - static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet); + static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet); /// Apply the settings ([OK] button). virtual bool FillItemSet(SfxItemSet* rSet) override; diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index b9f78c6a261b..e484d9afe924 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -268,7 +268,7 @@ void MailMergeCfg_Impl::Notify( const css::uno::Sequence< OUString >& ) } //typedef SfxTabPage* (*FNCreateTabPage)(TabPageParent pParent, const SfxItemSet &rAttrSet); -static VclPtr<SfxTabPage> CreateGeneralTabPage(sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet) +static std::unique_ptr<SfxTabPage> CreateGeneralTabPage(sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet) { CreateTabPage fnCreate = nullptr; switch(nId) @@ -309,8 +309,7 @@ static VclPtr<SfxTabPage> CreateGeneralTabPage(sal_uInt16 nId, TabPageParent pPa #endif } - VclPtr<SfxTabPage> pRet = fnCreate ? (*fnCreate)( pParent, &rSet ) : nullptr; - return pRet; + return fnCreate ? (*fnCreate)( pParent, &rSet ) : nullptr; } struct OptionsMapping_Impl @@ -440,13 +439,13 @@ static bool lcl_isOptionHidden( sal_uInt16 _nPageId, const SvtOptionsDialogOptio struct OptionsPageInfo { - ScopedVclPtr<SfxTabPage> m_pPage; + std::unique_ptr<SfxTabPage> m_xPage; sal_uInt16 m_nPageId; OUString m_sPageURL; OUString m_sEventHdl; std::unique_ptr<ExtensionsTabPage> m_xExtPage; - explicit OptionsPageInfo( sal_uInt16 nId ) : m_pPage( nullptr ), m_nPageId( nId ) {} + explicit OptionsPageInfo( sal_uInt16 nId ) : m_nPageId( nId ) {} }; struct OptionsGroupInfo @@ -530,16 +529,16 @@ OfaTreeOptionsDialog::~OfaTreeOptionsDialog() if (xTreeLB->get_iter_depth(*xEntry)) { OptionsPageInfo *pPageInfo = reinterpret_cast<OptionsPageInfo*>(xTreeLB->get_id(*xEntry).toInt64()); - if(pPageInfo->m_pPage) + if(pPageInfo->m_xPage) { - pPageInfo->m_pPage->FillUserData(); - OUString aPageData(pPageInfo->m_pPage->GetUserData()); + pPageInfo->m_xPage->FillUserData(); + OUString aPageData(pPageInfo->m_xPage->GetUserData()); if ( !aPageData.isEmpty() ) { SvtViewOptions aTabPageOpt( EViewType::TabPage, OUString::number( pPageInfo->m_nPageId) ); SetViewOptUserItem( aTabPageOpt, aPageData ); } - pPageInfo->m_pPage.disposeAndClear(); + pPageInfo->m_xPage.reset(); } if (pPageInfo->m_nPageId == RID_SFXPAGE_LINGU) @@ -621,13 +620,13 @@ IMPL_LINK_NOARG(OfaTreeOptionsDialog, BackHdl_Impl, weld::Button&, void) if (xCurrentPageEntry && xTreeLB->get_iter_depth(*xCurrentPageEntry)) { OptionsPageInfo* pPageInfo = reinterpret_cast<OptionsPageInfo*>(xTreeLB->get_id(*xCurrentPageEntry).toInt64()); - if (pPageInfo->m_pPage) + if (pPageInfo->m_xPage) { std::unique_ptr<weld::TreeIter> xParent = xTreeLB->make_iterator(xCurrentPageEntry.get()); xTreeLB->iter_parent(*xParent); OptionsGroupInfo* pGroupInfo = reinterpret_cast<OptionsGroupInfo*>(xTreeLB->get_id(*xParent).toInt64()); - pPageInfo->m_pPage->Reset( pGroupInfo->m_pInItemSet.get() ); + pPageInfo->m_xPage->Reset( pGroupInfo->m_pInItemSet.get() ); } else if ( pPageInfo->m_xExtPage ) pPageInfo->m_xExtPage->ResetPage(); @@ -643,13 +642,13 @@ void OfaTreeOptionsDialog::ApplyOptions(bool deactivate) if (xTreeLB->get_iter_depth(*xEntry)) { OptionsPageInfo* pPageInfo = reinterpret_cast<OptionsPageInfo*>(xTreeLB->get_id(*xEntry).toInt64()); - if ( pPageInfo->m_pPage && !pPageInfo->m_pPage->HasExchangeSupport() ) + if ( pPageInfo->m_xPage && !pPageInfo->m_xPage->HasExchangeSupport() ) { std::unique_ptr<weld::TreeIter> xParent = xTreeLB->make_iterator(xEntry.get()); xTreeLB->iter_parent(*xParent); OptionsGroupInfo* pGroupInfo = reinterpret_cast<OptionsGroupInfo*>(xTreeLB->get_id(*xParent).toInt64()); - pPageInfo->m_pPage->FillItemSet(pGroupInfo->m_pOutItemSet.get()); + pPageInfo->m_xPage->FillItemSet(pGroupInfo->m_pOutItemSet.get()); } if ( pPageInfo->m_xExtPage ) @@ -660,9 +659,9 @@ void OfaTreeOptionsDialog::ApplyOptions(bool deactivate) } pPageInfo->m_xExtPage->SavePage(); } - if ( pPageInfo->m_pPage && RID_OPTPAGE_CHART_DEFCOLORS == pPageInfo->m_nPageId ) + if ( pPageInfo->m_xPage && RID_OPTPAGE_CHART_DEFCOLORS == pPageInfo->m_nPageId ) { - SvxDefaultColorOptPage* pPage = static_cast<SvxDefaultColorOptPage *>(pPageInfo->m_pPage.get()); + SvxDefaultColorOptPage* pPage = static_cast<SvxDefaultColorOptPage *>(pPageInfo->m_xPage.get()); pPage->SaveChartOptions(); } } @@ -688,16 +687,16 @@ IMPL_LINK_NOARG(OfaTreeOptionsDialog, OKHdl_Impl, weld::Button&, void) if (xCurrentPageEntry && xTreeLB->get_iter_depth(*xCurrentPageEntry)) { OptionsPageInfo* pPageInfo = reinterpret_cast<OptionsPageInfo*>(xTreeLB->get_id(*xCurrentPageEntry).toInt64()); - if ( pPageInfo->m_pPage ) + if ( pPageInfo->m_xPage ) { std::unique_ptr<weld::TreeIter> xParent = xTreeLB->make_iterator(xCurrentPageEntry.get()); xTreeLB->iter_parent(*xParent); OptionsGroupInfo* pGroupInfo = reinterpret_cast<OptionsGroupInfo*>(xTreeLB->get_id(*xParent).toInt64()); if ( RID_SVXPAGE_COLOR != pPageInfo->m_nPageId - && pPageInfo->m_pPage->HasExchangeSupport() ) + && pPageInfo->m_xPage->HasExchangeSupport() ) { - DeactivateRC nLeave = pPageInfo->m_pPage->DeactivatePage(pGroupInfo->m_pOutItemSet.get()); + DeactivateRC nLeave = pPageInfo->m_xPage->DeactivatePage(pGroupInfo->m_pOutItemSet.get()); if ( nLeave == DeactivateRC::KeepPage ) { // the page mustn't be left @@ -705,7 +704,7 @@ IMPL_LINK_NOARG(OfaTreeOptionsDialog, OKHdl_Impl, weld::Button&, void) return; } } - pPageInfo->m_pPage->set_visible(false); + pPageInfo->m_xPage->set_visible(false); } } @@ -860,22 +859,19 @@ void OfaTreeOptionsDialog::SelectHdl_Impl() if (!bParent) return; - TabPage* pOldPage = nullptr; - TabPage* pNewPage = nullptr; + BuilderPage* pNewPage = nullptr; OptionsPageInfo* pOptPageInfo = (xCurrentPageEntry && xTreeLB->get_iter_depth(*xCurrentPageEntry)) ? reinterpret_cast<OptionsPageInfo*>(xTreeLB->get_id(*xCurrentPageEntry).toInt64()) : nullptr; - if ( pOptPageInfo && pOptPageInfo->m_pPage && pOptPageInfo->m_pPage->IsVisible() ) + if (pOptPageInfo && pOptPageInfo->m_xPage && pOptPageInfo->m_xPage->IsVisible()) { - pOldPage = pOptPageInfo->m_pPage; - std::unique_ptr<weld::TreeIter> xCurParent(xTreeLB->make_iterator(xCurrentPageEntry.get())); xTreeLB->iter_parent(*xCurParent); OptionsGroupInfo* pGroupInfo = reinterpret_cast<OptionsGroupInfo*>(xTreeLB->get_id(*xCurParent).toInt64()); DeactivateRC nLeave = DeactivateRC::LeavePage; - if ( RID_SVXPAGE_COLOR != pOptPageInfo->m_nPageId && pOptPageInfo->m_pPage->HasExchangeSupport() ) - nLeave = pOptPageInfo->m_pPage->DeactivatePage( pGroupInfo->m_pOutItemSet.get() ); + if ( RID_SVXPAGE_COLOR != pOptPageInfo->m_nPageId && pOptPageInfo->m_xPage->HasExchangeSupport() ) + nLeave = pOptPageInfo->m_xPage->DeactivatePage( pGroupInfo->m_pOutItemSet.get() ); if ( nLeave == DeactivateRC::KeepPage ) { @@ -884,7 +880,7 @@ void OfaTreeOptionsDialog::SelectHdl_Impl() return; } else - pOptPageInfo->m_pPage->set_visible(false); + pOptPageInfo->m_xPage->set_visible(false); } else if ( pOptPageInfo && pOptPageInfo->m_xExtPage ) { @@ -894,7 +890,7 @@ void OfaTreeOptionsDialog::SelectHdl_Impl() OptionsPageInfo *pPageInfo = reinterpret_cast<OptionsPageInfo*>(xTreeLB->get_id(*xEntry).toInt64()); OptionsGroupInfo* pGroupInfo = reinterpret_cast<OptionsGroupInfo*>(xTreeLB->get_id(*xParent).toInt64()); - if(!pPageInfo->m_pPage && pPageInfo->m_nPageId > 0) + if(!pPageInfo->m_xPage && pPageInfo->m_nPageId > 0) { if(!pGroupInfo->m_pInItemSet) pGroupInfo->m_pInItemSet = pGroupInfo->m_pShell @@ -907,17 +903,17 @@ void OfaTreeOptionsDialog::SelectHdl_Impl() TabPageParent pPageParent(xTabBox.get(), this); - pPageInfo->m_pPage.disposeAndReset( ::CreateGeneralTabPage(pPageInfo->m_nPageId, pPageParent, *pGroupInfo->m_pInItemSet ) ); + pPageInfo->m_xPage = ::CreateGeneralTabPage(pPageInfo->m_nPageId, pPageParent, *pGroupInfo->m_pInItemSet); - if(!pPageInfo->m_pPage && pGroupInfo->m_pModule) - pPageInfo->m_pPage.disposeAndReset(pGroupInfo->m_pModule->CreateTabPage(pPageInfo->m_nPageId, pPageParent, *pGroupInfo->m_pInItemSet)); + if(!pPageInfo->m_xPage && pGroupInfo->m_pModule) + pPageInfo->m_xPage = pGroupInfo->m_pModule->CreateTabPage(pPageInfo->m_nPageId, pPageParent, *pGroupInfo->m_pInItemSet); - DBG_ASSERT( pPageInfo->m_pPage, "tabpage could not created"); - if ( pPageInfo->m_pPage ) + DBG_ASSERT( pPageInfo->m_xPage, "tabpage could not created"); + if ( pPageInfo->m_xPage ) { SvtViewOptions aTabPageOpt( EViewType::TabPage, OUString::number( pPageInfo->m_nPageId) ); - pPageInfo->m_pPage->SetUserData( GetViewOptUserItem( aTabPageOpt ) ); - pPageInfo->m_pPage->Reset( pGroupInfo->m_pInItemSet.get() ); + pPageInfo->m_xPage->SetUserData( GetViewOptUserItem( aTabPageOpt ) ); + pPageInfo->m_xPage->Reset( pGroupInfo->m_pInItemSet.get() ); } } else if ( 0 == pPageInfo->m_nPageId && !pPageInfo->m_xExtPage ) @@ -931,14 +927,14 @@ void OfaTreeOptionsDialog::SelectHdl_Impl() xTabBox.get(), pPageInfo->m_sPageURL, pPageInfo->m_sEventHdl, m_xContainerWinProvider); } - if ( pPageInfo->m_pPage ) + if ( pPageInfo->m_xPage ) { if ( RID_SVXPAGE_COLOR != pPageInfo->m_nPageId && - pPageInfo->m_pPage->HasExchangeSupport()) + pPageInfo->m_xPage->HasExchangeSupport()) { - pPageInfo->m_pPage->ActivatePage(*pGroupInfo->m_pOutItemSet); + pPageInfo->m_xPage->ActivatePage(*pGroupInfo->m_pOutItemSet); } - pPageInfo->m_pPage->set_visible(true); + pPageInfo->m_xPage->set_visible(true); } else if ( pPageInfo->m_xExtPage ) { @@ -969,24 +965,12 @@ void OfaTreeOptionsDialog::SelectHdl_Impl() pLastPageSaver->m_sLastPageURL_Tools = pPageInfo->m_sPageURL; } } - pNewPage = pPageInfo->m_pPage; - - // restore lost focus, if necessary - vcl::Window* pFocusWin = Application::GetFocusWindow(); - // if the focused window is not the options treebox and the old page has the focus - if ( pFocusWin && !xTreeLB->has_focus() && pOldPage && pOldPage->HasChildPathFocus() ) - // then set the focus to the new page or if we are on a group set the focus to the options treebox - pNewPage ? pNewPage->GrabFocus() : xTreeLB->grab_focus(); + pNewPage = pPageInfo->m_xPage.get(); - //fdo#58170 use current page's layout child HelpId, unless there isn't a - //current page - OString sHelpId(HID_OFADLG_TREELISTBOX); - if (::isLayoutEnabled(pNewPage)) - { - vcl::Window *pFirstChild = pNewPage->GetWindow(GetWindowType::FirstChild); - assert(pFirstChild); - sHelpId = pFirstChild->GetHelpId(); - } + // fdo#58170 use current page's layout child HelpId, unless there isn't a current page + OString sHelpId(pNewPage ? pNewPage->GetHelpId() : OString()); + if (sHelpId.isEmpty()) + sHelpId = HID_OFADLG_TREELISTBOX; xTreeLB->set_help_id(sHelpId); } diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx index 2360efde8320..91fbd29fcdce 100644 --- a/cui/source/tabpages/align.cxx +++ b/cui/source/tabpages/align.cxx @@ -155,20 +155,14 @@ AlignmentTabPage::AlignmentTabPage(TabPageParent pParent, const SfxItemSet& rCor AlignmentTabPage::~AlignmentTabPage() { - disposeOnce(); -} - -void AlignmentTabPage::dispose() -{ m_xCtrlDial.reset(); m_xVsRefEdge.reset(); m_xLbFrameDir.reset(); - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> AlignmentTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) +std::unique_ptr<SfxTabPage> AlignmentTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<AlignmentTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<AlignmentTabPage>(pParent, *rAttrSet); } bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet ) @@ -584,15 +578,6 @@ DeactivateRC AlignmentTabPage::DeactivatePage( SfxItemSet* _pSet ) return DeactivateRC::LeavePage; } -void AlignmentTabPage::DataChanged( const DataChangedEvent& rDCEvt ) -{ - SfxTabPage::DataChanged( rDCEvt ); - if( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) ) - { - InitVsRefEgde(); - } -} - void AlignmentTabPage::InitVsRefEgde() { // remember selection - is deleted in call to ValueSet::Clear() diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 5fa49a106d6a..ff6095642cea 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -197,13 +197,12 @@ OfaAutocorrOptionsPage::OfaAutocorrOptionsPage(TabPageParent pParent, const SfxI OfaAutocorrOptionsPage::~OfaAutocorrOptionsPage() { - disposeOnce(); } -VclPtr<SfxTabPage> OfaAutocorrOptionsPage::Create(TabPageParent pParent, - const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> OfaAutocorrOptionsPage::Create(TabPageParent pParent, + const SfxItemSet* rSet) { - return VclPtr<OfaAutocorrOptionsPage>::Create(pParent, *rSet); + return std::make_unique<OfaAutocorrOptionsPage>(pParent, *rSet); } #define CBCOL_FIRST 0 @@ -393,13 +392,15 @@ void OfaSwAutoFmtOptionsPage::CreateEntry(const OUString& rTxt, sal_uInt16 nCol) OfaSwAutoFmtOptionsPage::~OfaSwAutoFmtOptionsPage() { - disposeOnce(); + delete reinterpret_cast<ImpUserData*>(m_xCheckLB->get_id(REPLACE_BULLETS).toInt64()); + delete reinterpret_cast<ImpUserData*>(m_xCheckLB->get_id(APPLY_NUMBERING).toInt64()); + delete reinterpret_cast<ImpUserData*>(m_xCheckLB->get_id(MERGE_SINGLE_LINE_PARA).toInt64()); } -VclPtr<SfxTabPage> OfaSwAutoFmtOptionsPage::Create(TabPageParent pParent, - const SfxItemSet* rAttrSet) +std::unique_ptr<SfxTabPage> OfaSwAutoFmtOptionsPage::Create(TabPageParent pParent, + const SfxItemSet* rAttrSet) { - return VclPtr<OfaSwAutoFmtOptionsPage>::Create(pParent, *rAttrSet); + return std::make_unique<OfaSwAutoFmtOptionsPage>(pParent, *rAttrSet); } bool OfaSwAutoFmtOptionsPage::FillItemSet( SfxItemSet* ) @@ -700,23 +701,16 @@ OfaAutocorrReplacePage::OfaAutocorrReplacePage(TabPageParent pParent, OfaAutocorrReplacePage::~OfaAutocorrReplacePage() { - disposeOnce(); -} - -void OfaAutocorrReplacePage::dispose() -{ aDoubleStringTable.clear(); aChangesTable.clear(); pCompareClass.reset(); pCharClass.reset(); - - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> OfaAutocorrReplacePage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> OfaAutocorrReplacePage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<OfaAutocorrReplacePage>::Create(pParent, *rSet); + return std::make_unique<OfaAutocorrReplacePage>(pParent, *rSet); } void OfaAutocorrReplacePage::ActivatePage( const SfxItemSet& ) @@ -1221,20 +1215,14 @@ OfaAutocorrExceptPage::OfaAutocorrExceptPage(TabPageParent pParent, const SfxIte OfaAutocorrExceptPage::~OfaAutocorrExceptPage() { - disposeOnce(); -} - -void OfaAutocorrExceptPage::dispose() -{ aStringsTable.clear(); pCompareClass.reset(); - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> OfaAutocorrExceptPage::Create(TabPageParent pParent, +std::unique_ptr<SfxTabPage> OfaAutocorrExceptPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<OfaAutocorrExceptPage>::Create(pParent, *rSet); + return std::make_unique<OfaAutocorrExceptPage>(pParent, *rSet); } void OfaAutocorrExceptPage::ActivatePage( const SfxItemSet& ) @@ -1595,13 +1583,12 @@ OfaQuoteTabPage::OfaQuoteTabPage(TabPageParent pParent, const SfxItemSet& rSet) OfaQuoteTabPage::~OfaQuoteTabPage() { - disposeOnce(); } -VclPtr<SfxTabPage> OfaQuoteTabPage::Create(TabPageParent pParent, - const SfxItemSet* rAttrSet) +std::unique_ptr<SfxTabPage> OfaQuoteTabPage::Create(TabPageParent pParent, + const SfxItemSet* rAttrSet) { - return VclPtr<OfaQuoteTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<OfaQuoteTabPage>(pParent, *rAttrSet); } bool OfaQuoteTabPage::FillItemSet( SfxItemSet* ) @@ -1912,21 +1899,12 @@ OfaAutoCompleteTabPage::OfaAutoCompleteTabPage(TabPageParent pParent, OfaAutoCompleteTabPage::~OfaAutoCompleteTabPage() { - disposeOnce(); -} - -void OfaSwAutoFmtOptionsPage::dispose() -{ - delete reinterpret_cast<ImpUserData*>(m_xCheckLB->get_id(REPLACE_BULLETS).toInt64()); - delete reinterpret_cast<ImpUserData*>(m_xCheckLB->get_id(APPLY_NUMBERING).toInt64()); - delete reinterpret_cast<ImpUserData*>(m_xCheckLB->get_id(MERGE_SINGLE_LINE_PARA).toInt64()); - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> OfaAutoCompleteTabPage::Create(TabPageParent pParent, +std::unique_ptr<SfxTabPage> OfaAutoCompleteTabPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<OfaAutoCompleteTabPage>::Create(pParent, *rSet); + return std::make_unique<OfaAutoCompleteTabPage>(pParent, *rSet); } bool OfaAutoCompleteTabPage::FillItemSet( SfxItemSet* ) @@ -2137,12 +2115,11 @@ OfaSmartTagOptionsTabPage::OfaSmartTagOptionsTabPage(TabPageParent pParent, OfaSmartTagOptionsTabPage::~OfaSmartTagOptionsTabPage() { - disposeOnce(); } -VclPtr<SfxTabPage> OfaSmartTagOptionsTabPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> OfaSmartTagOptionsTabPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<OfaSmartTagOptionsTabPage>::Create(pParent, *rSet); + return std::make_unique<OfaSmartTagOptionsTabPage>(pParent, *rSet); } /** This struct is used to associate list box entries with smart tag data diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index d033764ff8aa..fd2b034607fa 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -315,11 +315,6 @@ SvxBackgroundTabPage::SvxBackgroundTabPage(TabPageParent pParent, const SfxItemS SvxBackgroundTabPage::~SvxBackgroundTabPage() { - disposeOnce(); -} - -void SvxBackgroundTabPage::dispose() -{ m_pLoadIdle.reset(); pImportDlg.reset(); m_pCellBrush.reset(); @@ -333,13 +328,11 @@ void SvxBackgroundTabPage::dispose() m_xPreview1.reset(); m_xBackgroundColorSet.reset(); m_xWndPosition.reset(); - - SvxTabPage::dispose(); } -VclPtr<SfxTabPage> SvxBackgroundTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) +std::unique_ptr<SfxTabPage> SvxBackgroundTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SvxBackgroundTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SvxBackgroundTabPage>(pParent, *rAttrSet); } void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet ) @@ -1399,13 +1392,7 @@ SvxBkgTabPage::SvxBkgTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs) SvxBkgTabPage::~SvxBkgTabPage() { - disposeOnce(); -} - -void SvxBkgTabPage::dispose() -{ m_xTblLBox.reset(); - SvxAreaTabPage::dispose(); } void SvxBkgTabPage::ActivatePage( const SfxItemSet& ) @@ -1539,9 +1526,9 @@ bool SvxBkgTabPage::FillItemSet( SfxItemSet* rCoreSet ) return true; } -VclPtr<SfxTabPage> SvxBkgTabPage::Create(TabPageParent pWindow, const SfxItemSet* rAttrs) +std::unique_ptr<SfxTabPage> SvxBkgTabPage::Create(TabPageParent pWindow, const SfxItemSet* rAttrs) { - auto xRet = VclPtr<SvxBkgTabPage>::Create(pWindow, *rAttrs); + auto xRet = std::make_unique<SvxBkgTabPage>(pWindow, *rAttrs); xRet->SetOptimalSize(pWindow.pController); return xRet; } diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx index 4ff40e150845..375d8b3fc1ad 100644 --- a/cui/source/tabpages/border.cxx +++ b/cui/source/tabpages/border.cxx @@ -534,11 +534,6 @@ SvxBorderTabPage::SvxBorderTabPage(TabPageParent pParent, const SfxItemSet& rCor SvxBorderTabPage::~SvxBorderTabPage() { - disposeOnce(); -} - -void SvxBorderTabPage::dispose() -{ m_xLbShadowColor.reset(); m_xWndShadowsWin.reset(); m_xWndShadows.reset(); @@ -547,13 +542,12 @@ void SvxBorderTabPage::dispose() m_xFrameSelWin.reset(); m_xWndPresetsWin.reset(); m_xWndPresets.reset(); - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> SvxBorderTabPage::Create( TabPageParent pParent, +std::unique_ptr<SfxTabPage> SvxBorderTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<SvxBorderTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SvxBorderTabPage>(pParent, *rAttrSet); } void SvxBorderTabPage::ResetFrameLine_Impl( svx::FrameBorderType eBorder, const SvxBorderLine* pCoreLine, bool bValid ) @@ -1492,14 +1486,6 @@ void SvxBorderTabPage::UpdateRemoveAdjCellBorderCB( sal_uInt16 nPreset ) } } -void SvxBorderTabPage::DataChanged( const DataChangedEvent& rDCEvt ) -{ - if( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) ) - FillValueSets(); - - SfxTabPage::DataChanged( rDCEvt ); -} - void SvxBorderTabPage::PageCreated(const SfxAllItemSet& aSet) { const SfxUInt16Item* pSWModeItem = aSet.GetItem<SfxUInt16Item>(SID_SWMODE_TYPE, false); diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index b66ef21e8332..548b77ae7495 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -330,11 +330,6 @@ SvxCharNamePage::SvxCharNamePage(TabPageParent pParent, const SfxItemSet& rInSet SvxCharNamePage::~SvxCharNamePage() { - disposeOnce(); -} - -void SvxCharNamePage::dispose() -{ m_pImpl.reset(); m_xCTLFontStyleLB.reset(); m_xEastFontLanguageLB.reset(); @@ -346,7 +341,6 @@ void SvxCharNamePage::dispose() m_xPreviewWin.reset(); m_xCTLFontLanguageLB.reset(); m_xEastFontLanguageLB.reset(); - SvxCharBasePage::dispose(); } void SvxCharNamePage::Initialize() @@ -1196,9 +1190,9 @@ DeactivateRC SvxCharNamePage::DeactivatePage( SfxItemSet* _pSet ) return DeactivateRC::LeavePage; } -VclPtr<SfxTabPage> SvxCharNamePage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> SvxCharNamePage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<SvxCharNamePage>::Create(pParent, *rSet ); + return std::make_unique<SvxCharNamePage>(pParent, *rSet ); } void SvxCharNamePage::Reset( const SfxItemSet* rSet ) @@ -1374,15 +1368,9 @@ Color SvxCharEffectsPage::GetPreviewFontColor(const Color& rColor) const SvxCharEffectsPage::~SvxCharEffectsPage() { - disposeOnce(); -} - -void SvxCharEffectsPage::dispose() -{ m_xUnderlineColorLB.reset(); m_xOverlineColorLB.reset(); m_xFontColorLB.reset(); - SvxCharBasePage::dispose(); } void SvxCharEffectsPage::Initialize() @@ -1681,9 +1669,9 @@ DeactivateRC SvxCharEffectsPage::DeactivatePage( SfxItemSet* _pSet ) return DeactivateRC::LeavePage; } -VclPtr<SfxTabPage> SvxCharEffectsPage::Create( TabPageParent pParent, const SfxItemSet* rSet ) +std::unique_ptr<SfxTabPage> SvxCharEffectsPage::Create( TabPageParent pParent, const SfxItemSet* rSet ) { - return VclPtr<SvxCharEffectsPage>::Create( pParent, *rSet ); + return std::make_unique<SvxCharEffectsPage>( pParent, *rSet ); } void SvxCharEffectsPage::Reset( const SfxItemSet* rSet ) @@ -2672,9 +2660,9 @@ DeactivateRC SvxCharPositionPage::DeactivatePage( SfxItemSet* _pSet ) return DeactivateRC::LeavePage; } -VclPtr<SfxTabPage> SvxCharPositionPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> SvxCharPositionPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<SvxCharPositionPage>::Create(pParent, *rSet); + return std::make_unique<SvxCharPositionPage>(pParent, *rSet); } void SvxCharPositionPage::Reset( const SfxItemSet* rSet ) @@ -3191,9 +3179,9 @@ DeactivateRC SvxCharTwoLinesPage::DeactivatePage( SfxItemSet* _pSet ) return DeactivateRC::LeavePage; } -VclPtr<SfxTabPage> SvxCharTwoLinesPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> SvxCharTwoLinesPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<SvxCharTwoLinesPage>::Create(pParent, *rSet); + return std::make_unique<SvxCharTwoLinesPage>(pParent, *rSet); } void SvxCharTwoLinesPage::Reset( const SfxItemSet* rSet ) diff --git a/cui/source/tabpages/connect.cxx b/cui/source/tabpages/connect.cxx index 22283158d5a8..b64ea936ede0 100644 --- a/cui/source/tabpages/connect.cxx +++ b/cui/source/tabpages/connect.cxx @@ -45,18 +45,17 @@ const sal_uInt16 SvxConnectionPage::pRanges[] = |* dialog for changing connectors |* \************************************************************************/ - SvxConnectionDialog::SvxConnectionDialog(weld::Window* pParent, const SfxItemSet& rInAttrs, const SdrView* pSdrView) : SfxSingleTabDialogController(pParent, &rInAttrs) { TabPageParent pPageParent(get_content_area(), this); - VclPtrInstance<SvxConnectionPage> pPage(pPageParent, rInAttrs); + auto xPage = std::make_unique<SvxConnectionPage>(pPageParent, rInAttrs); - pPage->SetView(pSdrView); - pPage->Construct(); + xPage->SetView(pSdrView); + xPage->Construct(); - SetTabPage(pPage); - m_xDialog->set_title(CuiResId( RID_SVXSTR_CONNECTOR)); + SetTabPage(std::move(xPage)); + m_xDialog->set_title(CuiResId(RID_SVXSTR_CONNECTOR)); } /************************************************************************* @@ -121,13 +120,7 @@ SvxConnectionPage::SvxConnectionPage(TabPageParent pWindow, const SfxItemSet& rI SvxConnectionPage::~SvxConnectionPage() { - disposeOnce(); -} - -void SvxConnectionPage::dispose() -{ m_xCtlPreview.reset(); - SfxTabPage::dispose(); } /************************************************************************* @@ -311,11 +304,10 @@ void SvxConnectionPage::Construct() |* creates the page |* \************************************************************************/ - -VclPtr<SfxTabPage> SvxConnectionPage::Create(TabPageParent pParent, +std::unique_ptr<SfxTabPage> SvxConnectionPage::Create(TabPageParent pParent, const SfxItemSet* rAttrs) { - return VclPtr<SvxConnectionPage>::Create(pParent, *rAttrs); + return std::make_unique<SvxConnectionPage>(pParent, *rAttrs); } IMPL_LINK_NOARG(SvxConnectionPage, ChangeAttrListBoxHdl_Impl, weld::ComboBox&, void) diff --git a/cui/source/tabpages/dstribut.cxx b/cui/source/tabpages/dstribut.cxx index 30a42e94f8f1..de3ca435f362 100644 --- a/cui/source/tabpages/dstribut.cxx +++ b/cui/source/tabpages/dstribut.cxx @@ -33,8 +33,8 @@ SvxDistributeDialog::SvxDistributeDialog(weld::Window* pParent, "DistributionDialog") { TabPageParent pPageParent(get_content_area(), this); - mpPage = VclPtr<SvxDistributePage>::Create(pPageParent, rInAttrs, eHor, eVer); - SetTabPage(mpPage); + SetTabPage(std::make_unique<SvxDistributePage>(pPageParent, rInAttrs, eHor, eVer)); + mpPage = static_cast<SvxDistributePage*>(GetTabPage()); } SvxDistributeDialog::~SvxDistributeDialog() diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx index 7defa0a2b08e..a9030218e0d9 100644 --- a/cui/source/tabpages/grfpage.cxx +++ b/cui/source/tabpages/grfpage.cxx @@ -103,18 +103,12 @@ SvxGrfCropPage::SvxGrfCropPage(TabPageParent pParent, const SfxItemSet &rSet) SvxGrfCropPage::~SvxGrfCropPage() { - disposeOnce(); -} - -void SvxGrfCropPage::dispose() -{ m_xExampleWN.reset(); - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> SvxGrfCropPage::Create(TabPageParent pParent, const SfxItemSet *rSet) +std::unique_ptr<SfxTabPage> SvxGrfCropPage::Create(TabPageParent pParent, const SfxItemSet *rSet) { - return VclPtr<SvxGrfCropPage>::Create(pParent, *rSet); + return std::make_unique<SvxGrfCropPage>(pParent, *rSet); } void SvxGrfCropPage::Reset( const SfxItemSet *rSet ) @@ -666,12 +660,12 @@ void SvxGrfCropPage::GraphicHasChanged( bool bFound ) m_xZoomConstRB->set_sensitive(bFound); } -Size SvxGrfCropPage::GetGrfOrigSize( const Graphic& rGrf ) const +Size SvxGrfCropPage::GetGrfOrigSize(const Graphic& rGrf) { const MapMode aMapTwip( MapUnit::MapTwip ); Size aSize( rGrf.GetPrefSize() ); if( MapUnit::MapPixel == rGrf.GetPrefMapMode().GetMapUnit() ) - aSize = PixelToLogic( aSize, aMapTwip ); + aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, aMapTwip); else aSize = OutputDevice::LogicToLogic( aSize, rGrf.GetPrefMapMode(), aMapTwip ); diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx index 8b60ac8501d8..7480e488cbaa 100644 --- a/cui/source/tabpages/labdlg.cxx +++ b/cui/source/tabpages/labdlg.cxx @@ -134,14 +134,8 @@ SvxCaptionTabPage::SvxCaptionTabPage(TabPageParent pParent, const SfxItemSet& rI SvxCaptionTabPage::~SvxCaptionTabPage() { - disposeOnce(); -} - -void SvxCaptionTabPage::dispose() -{ m_xCT_CAPTTYPEWin.reset(); m_xCT_CAPTTYPE.reset(); - SfxTabPage::dispose(); } void SvxCaptionTabPage::Construct() @@ -338,10 +332,10 @@ void SvxCaptionTabPage::Reset( const SfxItemSet* ) SetupType_Impl( nCaptionType ); } -VclPtr<SfxTabPage> SvxCaptionTabPage::Create(TabPageParent pParent, +std::unique_ptr<SfxTabPage> SvxCaptionTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs) { - return VclPtr<SvxCaptionTabPage>::Create(pParent, *rOutAttrs); + return std::make_unique<SvxCaptionTabPage>(pParent, *rOutAttrs); } void SvxCaptionTabPage::SetupExtension_Impl( sal_uInt16 nType ) @@ -457,13 +451,6 @@ void SvxCaptionTabPage::SetupType_Impl( SdrCaptionType nType ) } } -void SvxCaptionTabPage::DataChanged( const DataChangedEvent& rDCEvt ) -{ - SfxTabPage::DataChanged( rDCEvt ); - - if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) ) - FillValueSet(); -} void SvxCaptionTabPage::FillValueSet() { m_xCT_CAPTTYPE->SetItemImage(BMP_CAPTTYPE_1, m_aBmpCapTypes[0] ); diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx index cabe3bb31af3..e2ea708880cf 100644 --- a/cui/source/tabpages/macroass.cxx +++ b/cui/source/tabpages/macroass.cxx @@ -125,13 +125,7 @@ SfxMacroTabPage::SfxMacroTabPage(TabPageParent pParent, const Reference< XFrame SfxMacroTabPage::~SfxMacroTabPage() { - disposeOnce(); -} - -void SfxMacroTabPage::dispose() -{ mpImpl.reset(); - SfxTabPage::dispose(); } void SfxMacroTabPage::AddEvent(const OUString& rEventName, SvMacroItemId nEventId) @@ -369,13 +363,13 @@ void SfxMacroTabPage::FillEvents() namespace { - VclPtr<SfxMacroTabPage> CreateSfxMacroTabPage(TabPageParent pParent, const SfxItemSet& rAttrSet) + std::unique_ptr<SfxMacroTabPage> CreateSfxMacroTabPage(TabPageParent pParent, const SfxItemSet& rAttrSet) { - return VclPtr<SfxMacroTabPage>::Create( pParent, nullptr, rAttrSet ); + return std::make_unique<SfxMacroTabPage>( pParent, nullptr, rAttrSet ); } } -VclPtr<SfxTabPage> SfxMacroTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) +std::unique_ptr<SfxTabPage> SfxMacroTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { return CreateSfxMacroTabPage(pParent, *rAttrSet); } @@ -386,10 +380,10 @@ SfxMacroAssignDlg::SfxMacroAssignDlg(weld::Widget* pParent, "EventAssignDialog") { TabPageParent pPageParent(get_content_area(), this); - VclPtr<SfxMacroTabPage> pPage = CreateSfxMacroTabPage(pPageParent, rSet); - pPage->SetFrame(rxDocumentFrame); - SetTabPage(pPage); - pPage->LaunchFillGroup(); + std::unique_ptr<SfxMacroTabPage> xPage = CreateSfxMacroTabPage(pPageParent, rSet); + xPage->SetFrame(rxDocumentFrame); + SetTabPage(std::move(xPage)); + GetTabPage()->LaunchFillGroup(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx index 63eeb1a3ce8d..9ca74cff4514 100644 --- a/cui/source/tabpages/measure.cxx +++ b/cui/source/tabpages/measure.cxx @@ -48,18 +48,17 @@ const sal_uInt16 SvxMeasurePage::pRanges[] = |* Dialog to change measure-attributes |* \************************************************************************/ - SvxMeasureDialog::SvxMeasureDialog(weld::Window* pParent, const SfxItemSet& rInAttrs, const SdrView* pSdrView) : SfxSingleTabDialogController(pParent, &rInAttrs) { TabPageParent pPageParent(get_content_area(), this); - VclPtrInstance<SvxMeasurePage> pPage(pPageParent, rInAttrs); + auto xPage = std::make_unique<SvxMeasurePage>(pPageParent, rInAttrs); - pPage->SetView(pSdrView); - pPage->Construct(); + xPage->SetView(pSdrView); + xPage->Construct(); - SetTabPage(pPage); + SetTabPage(std::move(xPage)); m_xDialog->set_title(CuiResId(RID_SVXSTR_DIMENSION_LINE)); } @@ -130,14 +129,8 @@ SvxMeasurePage::SvxMeasurePage(TabPageParent pWindow, const SfxItemSet& rInAttrs SvxMeasurePage::~SvxMeasurePage() { - disposeOnce(); -} - -void SvxMeasurePage::dispose() -{ m_xCtlPreview.reset(); m_xCtlPosition.reset(); - SvxTabPage::dispose(); } /************************************************************************* @@ -527,10 +520,10 @@ void SvxMeasurePage::Construct() m_aCtlPreview.Invalidate(); } -VclPtr<SfxTabPage> SvxMeasurePage::Create(TabPageParent pParent, +std::unique_ptr<SfxTabPage> SvxMeasurePage::Create(TabPageParent pParent, const SfxItemSet* rAttrs) { - return VclPtr<SvxMeasurePage>::Create(pParent, *rAttrs); + return std::make_unique<SvxMeasurePage>(pParent, *rAttrs); } void SvxMeasurePage::PointChanged(weld::DrawingArea* pDrawingArea, RectPoint /*eRP*/) diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx index 1e0493a2eadf..d8a9fee0948a 100644 --- a/cui/source/tabpages/numfmt.cxx +++ b/cui/source/tabpages/numfmt.cxx @@ -239,16 +239,10 @@ SvxNumberFormatTabPage::SvxNumberFormatTabPage(TabPageParent pParent, SvxNumberFormatTabPage::~SvxNumberFormatTabPage() { - disposeOnce(); -} - -void SvxNumberFormatTabPage::dispose() -{ pNumFmtShell.reset(); pNumItem.reset(); m_xWndPreview.reset(); m_xLbLanguage.reset(); - SfxTabPage::dispose(); } void SvxNumberFormatTabPage::Init_Impl() @@ -313,10 +307,10 @@ void SvxNumberFormatTabPage::Init_Impl() m_xLbLanguage->InsertLanguage( LANGUAGE_SYSTEM ); } -VclPtr<SfxTabPage> SvxNumberFormatTabPage::Create( TabPageParent pParent, +std::unique_ptr<SfxTabPage> SvxNumberFormatTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) { - return VclPtr<SvxNumberFormatTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SvxNumberFormatTabPage>(pParent, *rAttrSet); } diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index 902dd01fbea6..093debdf6319 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -203,20 +203,14 @@ SvxSingleNumPickTabPage::SvxSingleNumPickTabPage(TabPageParent pParent, const Sf SvxSingleNumPickTabPage::~SvxSingleNumPickTabPage() { - disposeOnce(); -} - -void SvxSingleNumPickTabPage::dispose() -{ m_xExamplesVSWin.reset(); m_xExamplesVS.reset(); - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> SvxSingleNumPickTabPage::Create(TabPageParent pParent, +std::unique_ptr<SfxTabPage> SvxSingleNumPickTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SvxSingleNumPickTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SvxSingleNumPickTabPage>(pParent, *rAttrSet); } bool SvxSingleNumPickTabPage::FillItemSet( SfxItemSet* rSet ) @@ -361,20 +355,14 @@ SvxBulletPickTabPage::SvxBulletPickTabPage(TabPageParent pParent, const SfxItemS SvxBulletPickTabPage::~SvxBulletPickTabPage() { - disposeOnce(); -} - -void SvxBulletPickTabPage::dispose() -{ m_xExamplesVSWin.reset(); m_xExamplesVS.reset(); - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> SvxBulletPickTabPage::Create(TabPageParent pParent, +std::unique_ptr<SfxTabPage> SvxBulletPickTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SvxBulletPickTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SvxBulletPickTabPage>(pParent, *rAttrSet); } bool SvxBulletPickTabPage::FillItemSet( SfxItemSet* rSet ) @@ -550,20 +538,14 @@ SvxNumPickTabPage::SvxNumPickTabPage(TabPageParent pParent, const SfxItemSet& rS SvxNumPickTabPage::~SvxNumPickTabPage() { - disposeOnce(); -} - -void SvxNumPickTabPage::dispose() -{ m_xExamplesVSWin.reset(); m_xExamplesVS.reset(); - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> SvxNumPickTabPage::Create(TabPageParent pParent, +std::unique_ptr<SfxTabPage> SvxNumPickTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SvxNumPickTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SvxNumPickTabPage>(pParent, *rAttrSet); } bool SvxNumPickTabPage::FillItemSet( SfxItemSet* rSet ) @@ -794,20 +776,14 @@ SvxBitmapPickTabPage::SvxBitmapPickTabPage(TabPageParent pParent, const SfxItemS SvxBitmapPickTabPage::~SvxBitmapPickTabPage() { - disposeOnce(); -} - -void SvxBitmapPickTabPage::dispose() -{ m_xExamplesVSWin.reset(); m_xExamplesVS.reset(); - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> SvxBitmapPickTabPage::Create(TabPageParent pParent, +std::unique_ptr<SfxTabPage> SvxBitmapPickTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SvxBitmapPickTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SvxBitmapPickTabPage>(pParent, *rAttrSet); } void SvxBitmapPickTabPage::ActivatePage(const SfxItemSet& rSet) @@ -1130,16 +1106,10 @@ SvxNumOptionsTabPage::SvxNumOptionsTabPage(TabPageParent pParent, SvxNumOptionsTabPage::~SvxNumOptionsTabPage() { - disposeOnce(); -} - -void SvxNumOptionsTabPage::dispose() -{ m_xPreviewWIN.reset(); m_xBulColLB.reset(); pActNum.reset(); pSaveNum.reset(); - SfxTabPage::dispose(); } void SvxNumOptionsTabPage::SetMetric(FieldUnit eMetric) @@ -1153,10 +1123,10 @@ void SvxNumOptionsTabPage::SetMetric(FieldUnit eMetric) m_xHeightMF->set_unit(eMetric); } -VclPtr<SfxTabPage> SvxNumOptionsTabPage::Create(TabPageParent pParent, +std::unique_ptr<SfxTabPage> SvxNumOptionsTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SvxNumOptionsTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SvxNumOptionsTabPage>(pParent, *rAttrSet); }; void SvxNumOptionsTabPage::ActivatePage(const SfxItemSet& rSet) @@ -2552,18 +2522,12 @@ SvxNumPositionTabPage::SvxNumPositionTabPage(TabPageParent pParent, const SfxIte SvxNumPositionTabPage::~SvxNumPositionTabPage() { - disposeOnce(); -} - -void SvxNumPositionTabPage::dispose() -{ if (m_pLevelHdlEvent) { Application::RemoveUserEvent(m_pLevelHdlEvent); m_pLevelHdlEvent = nullptr; } m_xPreviewWIN.reset(); - SfxTabPage::dispose(); } /*-------------------------------------------------------*/ @@ -2952,10 +2916,10 @@ void SvxNumPositionTabPage::ShowControlsDependingOnPosAndSpaceMode() m_xIndentAtMF->set_visible( bLabelAlignmentPosAndSpaceModeActive ); } -VclPtr<SfxTabPage> SvxNumPositionTabPage::Create(TabPageParent pParent, +std::unique_ptr<SfxTabPage> SvxNumPositionTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SvxNumPositionTabPage>::Create(pParent, *rAttrSet); + return std::make_unique<SvxNumPositionTabPage>(pParent, *rAttrSet); } void SvxNumPositionTabPage::SetMetric(FieldUnit eMetric) diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index f3df9bcec989..75c963016988 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -133,9 +133,9 @@ static bool IsEqualSize_Impl( const SvxSizeItem* pSize, const Size& rSize ) // class SvxPageDescPage -------------------------------------------------- -VclPtr<SfxTabPage> SvxPageDescPage::Create( TabPageParent pParent, const SfxItemSet* rSet ) +std::unique_ptr<SfxTabPage> SvxPageDescPage::Create( TabPageParent pParent, const SfxItemSet* rSet ) { - return VclPtr<SvxPageDescPage>::Create(pParent, *rSet); + return std::make_unique<SvxPageDescPage>(pParent, *rSet); } SvxPageDescPage::SvxPageDescPage(TabPageParent pParent, const SfxItemSet& rAttr) @@ -287,17 +287,11 @@ SvxPageDescPage::SvxPageDescPage(TabPageParent pParent, const SfxItemSet& rAttr) SvxPageDescPage::~SvxPageDescPage() { - disposeOnce(); -} - -void SvxPageDescPage::dispose() -{ if(mbDelPrinter) { mpDefPrinter.disposeAndClear(); mbDelPrinter = false; } - SfxTabPage::dispose(); } void SvxPageDescPage::Init_Impl() diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index 9ab9b5261720..b4299d7425f3 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -205,9 +205,9 @@ IMPL_LINK_NOARG(SvxStdParagraphTabPage, ELRLoseFocusHdl, weld::MetricSpinButton& ELRLoseFocus(); } -VclPtr<SfxTabPage> SvxStdParagraphTabPage::Create( TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> SvxStdParagraphTabPage::Create( TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<SvxStdParagraphTabPage>::Create(pParent, *rSet); + return std::make_unique<SvxStdParagraphTabPage>(pParent, *rSet); } bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet ) @@ -1059,9 +1059,9 @@ DeactivateRC SvxParaAlignTabPage::DeactivatePage( SfxItemSet* _pSet ) return DeactivateRC::LeavePage; } -VclPtr<SfxTabPage> SvxParaAlignTabPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> SvxParaAlignTabPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<SvxParaAlignTabPage>::Create(pParent, *rSet); + return std::make_unique<SvxParaAlignTabPage>(pParent, *rSet); } bool SvxParaAlignTabPage::FillItemSet( SfxItemSet* rOutSet ) @@ -1356,9 +1356,9 @@ void SvxParaAlignTabPage::PageCreated (const SfxAllItemSet& aSet) EnableJustifyExt(); } -VclPtr<SfxTabPage> SvxExtParagraphTabPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> SvxExtParagraphTabPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<SvxExtParagraphTabPage>::Create(pParent, *rSet); + return std::make_unique<SvxExtParagraphTabPage>(pParent, *rSet); } bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet ) @@ -2221,9 +2221,9 @@ SvxAsianTabPage::~SvxAsianTabPage() { } -VclPtr<SfxTabPage> SvxAsianTabPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> SvxAsianTabPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<SvxAsianTabPage>::Create(pParent, *rSet); + return std::make_unique<SvxAsianTabPage>(pParent, *rSet); } const sal_uInt16* SvxAsianTabPage::GetRanges() diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx index 35e4ae41a86a..0e6a3a0ace28 100644 --- a/cui/source/tabpages/swpossizetabpage.cxx +++ b/cui/source/tabpages/swpossizetabpage.cxx @@ -597,16 +597,10 @@ SvxSwPosSizeTabPage::SvxSwPosSizeTabPage(TabPageParent pParent, const SfxItemSet SvxSwPosSizeTabPage::~SvxSwPosSizeTabPage() { - disposeOnce(); -} - -void SvxSwPosSizeTabPage::dispose() -{ m_xWidthMF.reset(); m_xHeightMF.reset(); m_xHoriByMF.reset(); m_xVertByMF.reset(); - SfxTabPage::dispose(); } namespace @@ -708,9 +702,9 @@ void SvxSwPosSizeTabPage::setOptimalRelWidth() m_xHoriLB->clear(); } -VclPtr<SfxTabPage> SvxSwPosSizeTabPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> SvxSwPosSizeTabPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<SvxSwPosSizeTabPage>::Create(pParent, *rSet); + return std::make_unique<SvxSwPosSizeTabPage>(pParent, *rSet); } const sal_uInt16* SvxSwPosSizeTabPage::GetRanges() diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx index 8d448306887f..71eb7ffd1417 100644 --- a/cui/source/tabpages/tabstpge.cxx +++ b/cui/source/tabpages/tabstpge.cxx @@ -142,11 +142,6 @@ SvxTabulatorTabPage::SvxTabulatorTabPage(TabPageParent pParent, const SfxItemSet SvxTabulatorTabPage::~SvxTabulatorTabPage() { - disposeOnce(); -} - -void SvxTabulatorTabPage::dispose() -{ m_xDezWin.reset(); m_xCenterWin.reset(); m_xRightWin.reset(); @@ -154,7 +149,6 @@ void SvxTabulatorTabPage::dispose() m_xFillChar.reset(); m_xDezChar.reset(); m_xTabBox.reset(); - SfxTabPage::dispose(); } bool SvxTabulatorTabPage::FillItemSet(SfxItemSet* rSet) @@ -214,9 +208,9 @@ bool SvxTabulatorTabPage::FillItemSet(SfxItemSet* rSet) return bModified; } -VclPtr<SfxTabPage> SvxTabulatorTabPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> SvxTabulatorTabPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<SvxTabulatorTabPage>::Create(pParent, *rSet); + return std::make_unique<SvxTabulatorTabPage>(pParent, *rSet); } void SvxTabulatorTabPage::Reset(const SfxItemSet* rSet) diff --git a/cui/source/tabpages/textanim.cxx b/cui/source/tabpages/textanim.cxx index ecd5afdf5b8b..3a20a1e08ba1 100644 --- a/cui/source/tabpages/textanim.cxx +++ b/cui/source/tabpages/textanim.cxx @@ -377,9 +377,9 @@ bool SvxTextAnimationPage::FillItemSet( SfxItemSet* rAttrs) |* \************************************************************************/ -VclPtr<SfxTabPage> SvxTextAnimationPage::Create(TabPageParent pParent, const SfxItemSet* rAttrs) +std::unique_ptr<SfxTabPage> SvxTextAnimationPage::Create(TabPageParent pParent, const SfxItemSet* rAttrs) { - return VclPtr<SvxTextAnimationPage>::Create(pParent, *rAttrs); + return std::make_unique<SvxTextAnimationPage>(pParent, *rAttrs); } IMPL_LINK_NOARG(SvxTextAnimationPage, SelectEffectHdl_Impl, weld::ComboBox&, void) diff --git a/cui/source/tabpages/textattr.cxx b/cui/source/tabpages/textattr.cxx index 0b576d49a6e8..579c2b0436fa 100644 --- a/cui/source/tabpages/textattr.cxx +++ b/cui/source/tabpages/textattr.cxx @@ -474,9 +474,9 @@ void SvxTextAttrPage::Construct() m_xTsbWordWrapText->set_visible( bWordWrapTextEnabled ); } -VclPtr<SfxTabPage> SvxTextAttrPage::Create(TabPageParent pWindow, const SfxItemSet* rAttrs) +std::unique_ptr<SfxTabPage> SvxTextAttrPage::Create(TabPageParent pWindow, const SfxItemSet* rAttrs) { - return VclPtr<SvxTextAttrPage>::Create(pWindow, *rAttrs); + return std::make_unique<SvxTextAttrPage>(pWindow, *rAttrs); } /** Check whether we have to uncheck the "Full width" check box. diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx index ae15bf68ebfc..44f9864b147c 100644 --- a/cui/source/tabpages/tparea.cxx +++ b/cui/source/tabpages/tparea.cxx @@ -114,34 +114,34 @@ void SvxAreaTabPage::SetOptimalSize(weld::DialogController* pController) TabPageParent aFillTab(m_xFillTab.get(), pController); // Calculate optimal size of all pages... - m_pFillTabPage.disposeAndReset(SvxColorTabPage::Create(aFillTab, &m_rXFSet)); + m_xFillTabPage = SvxColorTabPage::Create(aFillTab, &m_rXFSet); Size aSize(m_xFillTab->get_preferred_size()); if (m_xBtnGradient->get_visible()) { - m_pFillTabPage.disposeAndReset(SvxGradientTabPage::Create(aFillTab, &m_rXFSet)); + m_xFillTabPage = SvxGradientTabPage::Create(aFillTab, &m_rXFSet); Size aGradientSize = m_xFillTab->get_preferred_size(); lclExtendSize(aSize, aGradientSize); } if (m_xBtnBitmap->get_visible()) { - m_pFillTabPage.disposeAndReset(SvxBitmapTabPage::Create(aFillTab, &m_rXFSet)); + m_xFillTabPage = SvxBitmapTabPage::Create(aFillTab, &m_rXFSet); Size aBitmapSize = m_xFillTab->get_preferred_size(); lclExtendSize(aSize, aBitmapSize); } if (m_xBtnHatch->get_visible()) { - m_pFillTabPage.disposeAndReset(SvxHatchTabPage::Create(aFillTab, &m_rXFSet)); + m_xFillTabPage = SvxHatchTabPage::Create(aFillTab, &m_rXFSet); Size aHatchSize = m_xFillTab->get_preferred_size(); lclExtendSize(aSize, aHatchSize); } if (m_xBtnPattern->get_visible()) { - m_pFillTabPage.disposeAndReset(SvxPatternTabPage::Create(aFillTab, &m_rXFSet)); + m_xFillTabPage = SvxPatternTabPage::Create(aFillTab, &m_rXFSet); Size aPatternSize = m_xFillTab->get_preferred_size(); lclExtendSize(aSize, aPatternSize); } - m_pFillTabPage.disposeAndClear(); + m_xFillTabPage.reset(); aSize.extendBy(10, 10); // apply a bit of margin @@ -150,13 +150,7 @@ void SvxAreaTabPage::SetOptimalSize(weld::DialogController* pController) SvxAreaTabPage::~SvxAreaTabPage() { - disposeOnce(); -} - -void SvxAreaTabPage::dispose() -{ - m_pFillTabPage.disposeAndClear(); - SfxTabPage::dispose(); + m_xFillTabPage.reset(); } void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet ) @@ -215,7 +209,7 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet ) template< typename TTabPage > DeactivateRC SvxAreaTabPage::DeactivatePage_Impl( SfxItemSet* _pSet ) { - return static_cast<TTabPage&>(*m_pFillTabPage).DeactivatePage(_pSet); + return static_cast<TTabPage&>(*m_xFillTabPage).DeactivatePage(_pSet); } DeactivateRC SvxAreaTabPage::DeactivatePage( SfxItemSet* _pSet ) @@ -253,7 +247,7 @@ DeactivateRC SvxAreaTabPage::DeactivatePage( SfxItemSet* _pSet ) template< typename TTabPage > bool SvxAreaTabPage::FillItemSet_Impl( SfxItemSet* rAttrs) { - return static_cast<TTabPage&>( *m_pFillTabPage ).FillItemSet( rAttrs ); + return static_cast<TTabPage&>( *m_xFillTabPage ).FillItemSet( rAttrs ); } bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs ) @@ -294,7 +288,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs ) template< typename TTabPage > void SvxAreaTabPage::Reset_Impl( const SfxItemSet* rAttrs ) { - static_cast<TTabPage&>( *m_pFillTabPage ).Reset( rAttrs ); + static_cast<TTabPage&>( *m_xFillTabPage ).Reset( rAttrs ); } void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs ) @@ -333,16 +327,16 @@ void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs ) } } -VclPtr<SfxTabPage> SvxAreaTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrs) +std::unique_ptr<SfxTabPage> SvxAreaTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrs) { - auto xRet = VclPtr<SvxAreaTabPage>::Create(pParent, *rAttrs); + auto xRet = std::make_unique<SvxAreaTabPage>(pParent, *rAttrs); xRet->SetOptimalSize(pParent.pController); return xRet; } namespace { -VclPtr<SfxTabPage> lcl_CreateFillStyleTabPage(sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet) +std::unique_ptr<SfxTabPage> lcl_CreateFillStyleTabPage(sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet) { CreateTabPage fnCreate = nullptr; switch(nId) @@ -354,8 +348,7 @@ VclPtr<SfxTabPage> lcl_CreateFillStyleTabPage(sal_uInt16 nId, TabPageParent pPar case BITMAP: fnCreate = &SvxBitmapTabPage::Create; break; case PATTERN: fnCreate = &SvxPatternTabPage::Create; break; } - VclPtr<SfxTabPage> pRet = fnCreate ? (*fnCreate)( pParent, &rSet ) : nullptr; - return pRet; + return fnCreate ? (*fnCreate)( pParent, &rSet ) : nullptr; } } @@ -381,10 +374,10 @@ void SvxAreaTabPage::SelectFillType(weld::ToggleButton& rButton, const SfxItemSe maBox.SelectButton(&rButton); FillType eFillType = static_cast<FillType>(maBox.GetCurrentButtonPos()); TabPageParent aFillTab(m_xFillTab.get(), GetDialogController()); - m_pFillTabPage.disposeAndReset(lcl_CreateFillStyleTabPage(eFillType, aFillTab, m_rXFSet)); - if (m_pFillTabPage) - m_pFillTabPage->SetDialogController(GetDialogController()); - CreatePage( eFillType , m_pFillTabPage); + m_xFillTabPage = lcl_CreateFillStyleTabPage(eFillType, aFillTab, m_rXFSet); + if (m_xFillTabPage) + m_xFillTabPage->SetDialogController(GetDialogController()); + CreatePage(eFillType, m_xFillTabPage.get()); } } @@ -418,7 +411,7 @@ void SvxAreaTabPage::CreatePage( sal_Int32 nId, SfxTabPage* pTab ) pColorTab->Construct(); pColorTab->ActivatePage(m_rXFSet); pColorTab->Reset(&m_rXFSet); - pColorTab->Show(); + pColorTab->set_visible(true); } else if(nId == GRADIENT) { @@ -430,7 +423,7 @@ void SvxAreaTabPage::CreatePage( sal_Int32 nId, SfxTabPage* pTab ) pGradientTab->Construct(); pGradientTab->ActivatePage(m_rXFSet); pGradientTab->Reset(&m_rXFSet); - pGradientTab->Show(); + pGradientTab->set_visible(true); } else if(nId == HATCH) { @@ -442,7 +435,7 @@ void SvxAreaTabPage::CreatePage( sal_Int32 nId, SfxTabPage* pTab ) pHatchTab->Construct(); pHatchTab->ActivatePage(m_rXFSet); pHatchTab->Reset(&m_rXFSet); - pHatchTab->Show(); + pHatchTab->set_visible(true); } else if(nId == BITMAP) { @@ -452,7 +445,7 @@ void SvxAreaTabPage::CreatePage( sal_Int32 nId, SfxTabPage* pTab ) pBitmapTab->Construct(); pBitmapTab->ActivatePage(m_rXFSet); pBitmapTab->Reset(&m_rXFSet); - pBitmapTab->Show(); + pBitmapTab->set_visible(true); } else if(nId == PATTERN) { @@ -464,7 +457,7 @@ void SvxAreaTabPage::CreatePage( sal_Int32 nId, SfxTabPage* pTab ) pPatternTab->Construct(); pPatternTab->ActivatePage(m_rXFSet); pPatternTab->Reset(&m_rXFSet); - pPatternTab->Show(); + pPatternTab->set_visible(true); } } diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx index 39f6a391e3e9..64ac9d6413a5 100644 --- a/cui/source/tabpages/tpbitmap.cxx +++ b/cui/source/tabpages/tpbitmap.cxx @@ -137,15 +137,9 @@ SvxBitmapTabPage::SvxBitmapTabPage(TabPageParent pParent, const SfxItemSet& rInA SvxBitmapTabPage::~SvxBitmapTabPage() { - disposeOnce(); -} - -void SvxBitmapTabPage::dispose() -{ m_xBitmapLBWin.reset(); m_xBitmapLB.reset(); m_xCtlBitmapPreview.reset(); - SfxTabPage::dispose(); } void SvxBitmapTabPage::Construct() @@ -300,7 +294,7 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs ) BitmapEx aBmpEx(pGraphicObject->GetGraphic().GetBitmapEx()); Size aTempBitmapSize = aBmpEx.GetSizePixel(); - rBitmapSize = PixelToLogic( aTempBitmapSize, MapMode(MapUnit::Map100thMM)); + rBitmapSize = Application::GetDefaultDevice()->PixelToLogic(aTempBitmapSize, MapMode(MapUnit::Map100thMM)); CalculateBitmapPresetSize(); bool bTiled = false; bool bStretched = false; @@ -422,9 +416,9 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs ) ClickBitmapHdl_Impl(); } -VclPtr<SfxTabPage> SvxBitmapTabPage::Create(TabPageParent pWindow, const SfxItemSet* rAttrs) +std::unique_ptr<SfxTabPage> SvxBitmapTabPage::Create(TabPageParent pWindow, const SfxItemSet* rAttrs) { - return VclPtr<SvxBitmapTabPage>::Create(pWindow, *rAttrs); + return std::make_unique<SvxBitmapTabPage>(pWindow, *rAttrs); } void SvxBitmapTabPage::ClickBitmapHdl_Impl() @@ -717,7 +711,9 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyTileOffsetHdl, weld::MetricSpinButton&, IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, weld::Button&, void) { - SvxOpenGraphicDialog aDlg(CuiResId(RID_SVXSTR_ADD_IMAGE), GetDialogFrameWeld()); + weld::Window* pDialogFrameWeld = GetDialogFrameWeld(); + + SvxOpenGraphicDialog aDlg(CuiResId(RID_SVXSTR_ADD_IMAGE), pDialogFrameWeld); aDlg.EnableLink(false); long nCount = m_pBitmapList->Count(); @@ -725,9 +721,9 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, weld::Button&, void) { Graphic aGraphic; - EnterWait(); + std::unique_ptr<weld::WaitObject> xWait(new weld::WaitObject(pDialogFrameWeld)); ErrCode nError = aDlg.GetGraphic( aGraphic ); - LeaveWait(); + xWait.reset(); if( !nError ) { @@ -738,7 +734,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, weld::Button&, void) INetURLObject aURL( aDlg.GetPath() ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog( - GetDialogFrameWeld(), aURL.GetLastName().getToken(0, '.'), aDesc)); + pDialogFrameWeld, aURL.GetLastName().getToken(0, '.'), aDesc)); nError = ErrCode(1); while( pDlg->Execute() == RET_OK ) @@ -756,7 +752,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, weld::Button&, void) break; } - std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDialogFrameWeld(), "cui/ui/queryduplicatedialog.ui")); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pDialogFrameWeld, "cui/ui/queryduplicatedialog.ui")); std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("DuplicateNameDialog")); if (xBox->run() != RET_OK) break; @@ -781,7 +777,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, weld::Button&, void) else { // graphic couldn't be loaded - std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDialogFrameWeld(), "cui/ui/querynoloadedfiledialog.ui")); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pDialogFrameWeld, "cui/ui/querynoloadedfiledialog.ui")); std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("NoLoadedFileDialog")); xBox->run(); } diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx index 1f7abce1eafb..936a1b8df51f 100644 --- a/cui/source/tabpages/tpcolor.cxx +++ b/cui/source/tabpages/tpcolor.cxx @@ -144,16 +144,10 @@ SvxColorTabPage::SvxColorTabPage(TabPageParent pParent, const SfxItemSet& rInAtt SvxColorTabPage::~SvxColorTabPage() { - disposeOnce(); -} - -void SvxColorTabPage::dispose() -{ m_xValSetRecentListWin.reset(); m_xValSetRecentList.reset(); m_xValSetColorListWin.reset(); m_xValSetColorList.reset(); - SfxTabPage::dispose(); } void SvxColorTabPage::ImpColorCountChanged() @@ -268,9 +262,9 @@ void SvxColorTabPage::Reset( const SfxItemSet* rSet ) UpdateModified(); } -VclPtr<SfxTabPage> SvxColorTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs) +std::unique_ptr<SfxTabPage> SvxColorTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs) { - return VclPtr<SvxColorTabPage>::Create(pParent, *rOutAttrs); + return std::make_unique<SvxColorTabPage>(pParent, *rOutAttrs); } // is called when the content of the MtrFields is changed for color values diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx index fee60f812be5..3a5733f856b4 100644 --- a/cui/source/tabpages/tpgradnt.cxx +++ b/cui/source/tabpages/tpgradnt.cxx @@ -114,17 +114,11 @@ SvxGradientTabPage::SvxGradientTabPage(TabPageParent pParent, const SfxItemSet& SvxGradientTabPage::~SvxGradientTabPage() { - disposeOnce(); -} - -void SvxGradientTabPage::dispose() -{ m_xCtlPreview.reset(); m_xGradientLBWin.reset(); m_xGradientLB.reset(); m_xLbColorTo.reset(); m_xLbColorFrom.reset(); - SfxTabPage::dispose(); } void SvxGradientTabPage::Construct() @@ -233,10 +227,10 @@ void SvxGradientTabPage::Reset( const SfxItemSet* ) m_xBtnModify->set_sensitive(false); } -VclPtr<SfxTabPage> SvxGradientTabPage::Create( TabPageParent pWindow, +std::unique_ptr<SfxTabPage> SvxGradientTabPage::Create( TabPageParent pWindow, const SfxItemSet* rOutAttrs ) { - return VclPtr<SvxGradientTabPage>::Create(pWindow, *rOutAttrs); + return std::make_unique<SvxGradientTabPage>(pWindow, *rOutAttrs); } IMPL_LINK( SvxGradientTabPage, ModifiedListBoxHdl_Impl, weld::ComboBox&, rListBox, void ) diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx index dc152538a9e7..88fc1f57ee47 100644 --- a/cui/source/tabpages/tphatch.cxx +++ b/cui/source/tabpages/tphatch.cxx @@ -110,22 +110,16 @@ SvxHatchTabPage::SvxHatchTabPage(TabPageParent pParent, const SfxItemSet& rInAtt m_xBtnAdd->connect_clicked( LINK( this, SvxHatchTabPage, ClickAddHdl_Impl ) ); m_xBtnModify->connect_clicked( LINK( this, SvxHatchTabPage, ClickModifyHdl_Impl ) ); - m_aCtlPreview.SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); + m_aCtlPreview.SetDrawMode(Application::GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR); } SvxHatchTabPage::~SvxHatchTabPage() { - disposeOnce(); -} - -void SvxHatchTabPage::dispose() -{ m_xCtlPreview.reset(); m_xHatchLBWin.reset(); m_xHatchLB.reset(); m_xLbBackgroundColor.reset(); m_xLbLineColor.reset(); - SfxTabPage::dispose(); } void SvxHatchTabPage::Construct() @@ -272,10 +266,10 @@ void SvxHatchTabPage::Reset( const SfxItemSet* rSet ) m_aCtlPreview.Invalidate(); } -VclPtr<SfxTabPage> SvxHatchTabPage::Create( TabPageParent pWindow, +std::unique_ptr<SfxTabPage> SvxHatchTabPage::Create( TabPageParent pWindow, const SfxItemSet* rSet ) { - return VclPtr<SvxHatchTabPage>::Create(pWindow, *rSet); + return std::make_unique<SvxHatchTabPage>(pWindow, *rSet); } IMPL_LINK( SvxHatchTabPage, ModifiedListBoxHdl_Impl, weld::ComboBox&, rListBox, void ) @@ -562,12 +556,4 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void ) } -void SvxHatchTabPage::DataChanged( const DataChangedEvent& rDCEvt ) -{ - if ( ( rDCEvt.GetType() == DataChangedEventType::SETTINGS ) && ( rDCEvt.GetFlags() & AllSettingsFlags::STYLE ) ) - m_aCtlPreview.SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); - - SfxTabPage::DataChanged( rDCEvt ); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx index 56b9294cbfb1..00e2e4eb10ec 100644 --- a/cui/source/tabpages/tpline.cxx +++ b/cui/source/tabpages/tpline.cxx @@ -207,11 +207,6 @@ void SvxLineTabPage::ShowSymbolControls(bool bOn) SvxLineTabPage::~SvxLineTabPage() { - disposeOnce(); -} - -void SvxLineTabPage::dispose() -{ m_xCtlPreview.reset(); m_xLbEndStyle.reset(); m_xLbStartStyle.reset(); @@ -219,8 +214,6 @@ void SvxLineTabPage::dispose() m_xLbLineStyle.reset(); m_aGalleryBrushItems.clear(); m_aSymbolBrushItems.clear(); - - SfxTabPage::dispose(); } void SvxLineTabPage::Construct() @@ -1183,10 +1176,10 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs ) ChangePreviewHdl_Impl( nullptr ); } -VclPtr<SfxTabPage> SvxLineTabPage::Create(TabPageParent pParent, +std::unique_ptr<SfxTabPage> SvxLineTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrs) { - return VclPtr<SvxLineTabPage>::Create(pParent, *rAttrs); + return std::make_unique<SvxLineTabPage>(pParent, *rAttrs); } IMPL_LINK_NOARG(SvxLineTabPage, ChangePreviewListBoxHdl_Impl, ColorListBox&, void) @@ -1659,16 +1652,6 @@ IMPL_LINK(SvxLineTabPage, RatioHdl_Impl, weld::ToggleButton&, rBox, void) } } -void SvxLineTabPage::DataChanged( const DataChangedEvent& rDCEvt ) -{ - SfxTabPage::DataChanged( rDCEvt ); - - if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) ) - { - FillListboxes(); - } -} - void SvxLineTabPage::PageCreated(const SfxAllItemSet& aSet) { const SvxDashListItem* pDashListItem = aSet.GetItem<SvxDashListItem>(SID_DASH_LIST, false); diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx index e83881292575..4ed54c75aa1e 100644 --- a/cui/source/tabpages/tplnedef.cxx +++ b/cui/source/tabpages/tplnedef.cxx @@ -137,14 +137,8 @@ SvxLineDefTabPage::SvxLineDefTabPage(TabPageParent pParent, const SfxItemSet& rI SvxLineDefTabPage::~SvxLineDefTabPage() { - disposeOnce(); -} - -void SvxLineDefTabPage::dispose() -{ m_xCtlPreview.reset(); m_xLbLineStyles.reset(); - SfxTabPage::dispose(); } void SvxLineDefTabPage::Construct() @@ -302,9 +296,9 @@ void SvxLineDefTabPage::Reset( const SfxItemSet* rAttrs ) } } -VclPtr<SfxTabPage> SvxLineDefTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs ) +std::unique_ptr<SfxTabPage> SvxLineDefTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs ) { - return VclPtr<SvxLineDefTabPage>::Create(pParent, *rOutAttrs); + return std::make_unique<SvxLineDefTabPage>(pParent, *rOutAttrs); } IMPL_LINK(SvxLineDefTabPage, SelectLinestyleListBoxHdl_Impl, weld::ComboBox&, rListBox, void) @@ -843,17 +837,4 @@ void SvxLineDefTabPage::FillDialog_Impl() m_xMtrDistance->save_value(); } -void SvxLineDefTabPage::DataChanged( const DataChangedEvent& rDCEvt ) -{ - SfxTabPage::DataChanged( rDCEvt ); - - if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) ) - { - auto nOldSelect = m_xLbLineStyles->get_active(); - m_xLbLineStyles->clear(); - m_xLbLineStyles->Fill(pDashList); - m_xLbLineStyles->set_active(nOldSelect); - } -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx index b146fecff049..3d108c81626b 100644 --- a/cui/source/tabpages/tplneend.cxx +++ b/cui/source/tabpages/tplneend.cxx @@ -91,14 +91,8 @@ SvxLineEndDefTabPage::SvxLineEndDefTabPage(TabPageParent pParent, const SfxItemS SvxLineEndDefTabPage::~SvxLineEndDefTabPage() { - disposeOnce(); -} - -void SvxLineEndDefTabPage::dispose() -{ m_xCtlPreview.reset(); m_xLbLineEnds.reset(); - SfxTabPage::dispose(); } void SvxLineEndDefTabPage::Construct() @@ -237,9 +231,9 @@ void SvxLineEndDefTabPage::Reset( const SfxItemSet* ) } } -VclPtr<SfxTabPage> SvxLineEndDefTabPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> SvxLineEndDefTabPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<SvxLineEndDefTabPage>::Create(pParent, *rSet ); + return std::make_unique<SvxLineEndDefTabPage>(pParent, *rSet ); } void SvxLineEndDefTabPage::SelectLineEndHdl_Impl() @@ -613,17 +607,4 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickSaveHdl_Impl, weld::Button&, void) } } -void SvxLineEndDefTabPage::DataChanged( const DataChangedEvent& rDCEvt ) -{ - SfxTabPage::DataChanged( rDCEvt ); - - if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) ) - { - auto nOldSelect = m_xLbLineEnds->get_active(); - m_xLbLineEnds->clear(); - m_xLbLineEnds->Fill(pLineEndList); - m_xLbLineEnds->set_active(nOldSelect); - } -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/tppattern.cxx b/cui/source/tabpages/tppattern.cxx index 7c1d713dc1b7..e4770e00bd6e 100644 --- a/cui/source/tabpages/tppattern.cxx +++ b/cui/source/tabpages/tppattern.cxx @@ -112,11 +112,6 @@ SvxPatternTabPage::SvxPatternTabPage(TabPageParent pParent, const SfxItemSet& rI SvxPatternTabPage::~SvxPatternTabPage() { - disposeOnce(); -} - -void SvxPatternTabPage::dispose() -{ m_xPatternLBWin.reset(); m_xCtlPreview.reset(); m_xCtlPixelWin.reset(); @@ -124,7 +119,6 @@ void SvxPatternTabPage::dispose() m_xLbBackgroundColor.reset(); m_xLbColor.reset(); m_xCtlPixel.reset(); - SvxTabPage::dispose(); } void SvxPatternTabPage::Construct() @@ -239,14 +233,12 @@ void SvxPatternTabPage::Reset( const SfxItemSet* ) } } - -VclPtr<SfxTabPage> SvxPatternTabPage::Create( TabPageParent pWindow, +std::unique_ptr<SfxTabPage> SvxPatternTabPage::Create( TabPageParent pWindow, const SfxItemSet* rSet ) { - return VclPtr<SvxPatternTabPage>::Create(pWindow, *rSet); + return std::make_unique<SvxPatternTabPage>(pWindow, *rSet); } - IMPL_LINK_NOARG(SvxPatternTabPage, ChangePatternHdl_Impl, SvtValueSet*, void) { std::unique_ptr<GraphicObject> pGraphicObject; diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx index a64b108657ba..b5e9c18d4961 100644 --- a/cui/source/tabpages/tpshadow.cxx +++ b/cui/source/tabpages/tpshadow.cxx @@ -157,15 +157,9 @@ SvxShadowTabPage::SvxShadowTabPage(TabPageParent pParent, const SfxItemSet& rInA SvxShadowTabPage::~SvxShadowTabPage() { - disposeOnce(); -} - -void SvxShadowTabPage::dispose() -{ m_xCtlXRectPreview.reset(); m_xLbShadowColor.reset(); m_xCtlPosition.reset(); - SvxTabPage::dispose(); } void SvxShadowTabPage::ActivatePage( const SfxItemSet& rSet ) @@ -418,10 +412,10 @@ void SvxShadowTabPage::Reset( const SfxItemSet* rAttrs ) ModifyShadowHdl_Impl(*m_xMtrTransparent); } -VclPtr<SfxTabPage> SvxShadowTabPage::Create( TabPageParent pParent, +std::unique_ptr<SfxTabPage> SvxShadowTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrs ) { - return VclPtr<SvxShadowTabPage>::Create( pParent, *rAttrs ); + return std::make_unique<SvxShadowTabPage>(pParent, *rAttrs); } IMPL_LINK_NOARG(SvxShadowTabPage, ClickShadowHdl_Impl, weld::ToggleButton&, void) diff --git a/cui/source/tabpages/tptrans.cxx b/cui/source/tabpages/tptrans.cxx index 389263205c9d..495135a60e01 100644 --- a/cui/source/tabpages/tptrans.cxx +++ b/cui/source/tabpages/tptrans.cxx @@ -244,9 +244,9 @@ SvxTransparenceTabPage::SvxTransparenceTabPage(TabPageParent pParent, const SfxI SetExchangeSupport(); } -VclPtr<SfxTabPage> SvxTransparenceTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrs) +std::unique_ptr<SfxTabPage> SvxTransparenceTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrs) { - return VclPtr<SvxTransparenceTabPage>::Create(pParent, *rAttrs); + return std::make_unique<SvxTransparenceTabPage>(pParent, *rAttrs); } bool SvxTransparenceTabPage::FillItemSet(SfxItemSet* rAttrs) diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx index 551509d6a8a0..06e9c2ccf201 100644 --- a/cui/source/tabpages/transfrm.cxx +++ b/cui/source/tabpages/transfrm.cxx @@ -301,9 +301,9 @@ void SvxAngleTabPage::Reset(const SfxItemSet* rAttrs) m_xMtrPosY->save_value(); } -VclPtr<SfxTabPage> SvxAngleTabPage::Create(TabPageParent pParent, const SfxItemSet* rSet) +std::unique_ptr<SfxTabPage> SvxAngleTabPage::Create(TabPageParent pParent, const SfxItemSet* rSet) { - return VclPtr<SvxAngleTabPage>::Create(pParent, *rSet); + return std::make_unique<SvxAngleTabPage>(pParent, *rSet); } void SvxAngleTabPage::ActivatePage(const SfxItemSet& rSet) @@ -700,9 +700,9 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs) } } -VclPtr<SfxTabPage> SvxSlantTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs) +std::unique_ptr<SfxTabPage> SvxSlantTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs) { - return VclPtr<SvxSlantTabPage>::Create(pParent, *rOutAttrs); + return std::make_unique<SvxSlantTabPage>(pParent, *rOutAttrs); } void SvxSlantTabPage::ActivatePage( const SfxItemSet& rSet ) @@ -1116,9 +1116,9 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* ) ChangeSizeProtectHdl(*m_xTsbSizeProtect); } -VclPtr<SfxTabPage> SvxPositionSizeTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs) +std::unique_ptr<SfxTabPage> SvxPositionSizeTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs) { - return VclPtr<SvxPositionSizeTabPage>::Create(pParent, *rOutAttrs); + return std::make_unique<SvxPositionSizeTabPage>(pParent, *rOutAttrs); } void SvxPositionSizeTabPage::ActivatePage( const SfxItemSet& rSet ) |