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>
diff --git a/chart2/source/controller/dialogs/dlg_ChartType.cxx b/chart2/source/controller/dialogs/dlg_ChartType.cxx
index 8848bc2..cde4833 100644
--- a/chart2/source/controller/dialogs/dlg_ChartType.cxx
+++ b/chart2/source/controller/dialogs/dlg_ChartType.cxx
@@ -34,18 +34,17 @@ ChartTypeDialog::ChartTypeDialog(weld::Window* pParent,
    , m_xContentArea(m_xDialog->weld_content_area())
{
    TabPageParent aParent(m_xContentArea.get(), this);
    m_xChartTypeTabPage = VclPtr<ChartTypeTabPage>::Create(
    m_xChartTypeTabPage = std::make_unique<ChartTypeTabPage>(
        aParent,
        uno::Reference<XChartDocument>::query(m_xChartModel),
        false/*don't show title description*/);

    m_xChartTypeTabPage->initializePage();
    m_xChartTypeTabPage->Show();
 }
}

ChartTypeDialog::~ChartTypeDialog()
{
    m_xChartTypeTabPage.disposeAndClear();
    m_xChartTypeTabPage.reset();
}

} //namespace chart
diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard.cxx
index adf1a52..228bcdb 100644
--- a/chart2/source/controller/dialogs/dlg_CreationWizard.cxx
+++ b/chart2/source/controller/dialogs/dlg_CreationWizard.cxx
@@ -84,9 +84,9 @@ CreationWizard::CreationWizard(weld::Window* pParent, const uno::Reference<frame

CreationWizard::~CreationWizard() = default;

VclPtr<TabPage> CreationWizard::createPage(WizardState nState)
std::unique_ptr<BuilderPage> CreationWizard::createPage(WizardState nState)
{
    VclPtr<vcl::OWizardPage> pRet;
    std::unique_ptr<vcl::OWizardPage> xRet;

    OString sIdent(OString::number(nState));
    weld::Container* pPageContainer = m_xAssistant->append_page(sIdent);
@@ -95,42 +95,41 @@ VclPtr<TabPage> CreationWizard::createPage(WizardState nState)

    switch( nState )
    {
    case STATE_CHARTTYPE:
        case STATE_CHARTTYPE:
        {
        m_aTimerTriggeredControllerLock.startTimer();
        VclPtrInstance<ChartTypeTabPage> pChartTypeTabPage(aParent, m_xChartModel);
        pRet  = pChartTypeTabPage;
        m_pTemplateProvider = pChartTypeTabPage;
        if (m_pDialogModel)
            m_pDialogModel->setTemplate( m_pTemplateProvider->getCurrentTemplate());
            m_aTimerTriggeredControllerLock.startTimer();
            xRet = std::make_unique<ChartTypeTabPage>(aParent, m_xChartModel);
            m_pTemplateProvider = static_cast<ChartTypeTabPage*>(xRet.get());
            if (m_pDialogModel)
                m_pDialogModel->setTemplate( m_pTemplateProvider->getCurrentTemplate());
            break;
        }
        break;
    case STATE_SIMPLE_RANGE:
        case STATE_SIMPLE_RANGE:
        {
        m_aTimerTriggeredControllerLock.startTimer();
        pRet = VclPtr<RangeChooserTabPage>::Create(aParent, *m_pDialogModel, m_pTemplateProvider, this);
            m_aTimerTriggeredControllerLock.startTimer();
            xRet = std::make_unique<RangeChooserTabPage>(aParent, *m_pDialogModel, m_pTemplateProvider, this);
            break;
        }
        break;
    case STATE_DATA_SERIES:
        case STATE_DATA_SERIES:
        {
        m_aTimerTriggeredControllerLock.startTimer();
        pRet = VclPtr<DataSourceTabPage>::Create(aParent, *m_pDialogModel, m_pTemplateProvider, this);
            m_aTimerTriggeredControllerLock.startTimer();
            xRet = std::make_unique<DataSourceTabPage>(aParent, *m_pDialogModel, m_pTemplateProvider, this);
            break;
        }
        break;
    case STATE_OBJECTS:
        case STATE_OBJECTS:
        {
        pRet  = VclPtr<TitlesAndObjectsTabPage>::Create(aParent, m_xChartModel, m_xComponentContext);
        m_aTimerTriggeredControllerLock.startTimer();
            xRet = std::make_unique<TitlesAndObjectsTabPage>(aParent, m_xChartModel, m_xComponentContext);
            m_aTimerTriggeredControllerLock.startTimer();
            break;
        }
        break;
    default:
        break;
        default:
            break;
    }

    if (pRet)
        pRet->SetText(OUString()); //remove title of pages to not get them in the wizard title
    if (xRet)
        xRet->SetPageTitle(OUString()); //remove title of pages to not get them in the wizard title

    return pRet;
    return xRet;
}

bool CreationWizard::leaveState( WizardState /*_nState*/ )
@@ -159,12 +158,12 @@ void CreationWizard::enterState(WizardState nState)
        vcl::RoadmapWizardMachine::enterState(nState);
}

void CreationWizard::setInvalidPage( TabPage * /* pTabPage */ )
void CreationWizard::setInvalidPage( BuilderPage * /* pTabPage */ )
{
    m_bCanTravel = false;
}

void CreationWizard::setValidPage( TabPage * /* pTabPage */ )
void CreationWizard::setValidPage( BuilderPage * /* pTabPage */ )
{
    m_bCanTravel = true;
}
diff --git a/chart2/source/controller/dialogs/dlg_DataSource.cxx b/chart2/source/controller/dialogs/dlg_DataSource.cxx
index 4bd8264..bb377bd 100644
--- a/chart2/source/controller/dialogs/dlg_DataSource.cxx
+++ b/chart2/source/controller/dialogs/dlg_DataSource.cxx
@@ -82,8 +82,6 @@ DataSourceDialog::DataSourceDialog(weld::Window * pParent,
                              "DataRangeDialog")
    , m_apDocTemplateProvider(new DocumentChartTypeTemplateProvider(xChartDocument))
    , m_apDialogModel(new DialogModel(xChartDocument, xContext))
    , m_pRangeChooserTabPage(nullptr)
    , m_pDataSourceTabPage(nullptr)
    , m_bRangeChooserTabIsValid(true)
    , m_bDataSourceTabIsValid(true)
    , m_bTogglingEnabled(true)
@@ -91,10 +89,10 @@ DataSourceDialog::DataSourceDialog(weld::Window * pParent,
    , m_xBtnOK(m_xBuilder->weld_button("ok"))
{
    TabPageParent aRangeParent(m_xTabControl->get_page("range"), this);
    m_pRangeChooserTabPage = VclPtr<RangeChooserTabPage>::Create(aRangeParent, *(m_apDialogModel.get()),
    m_xRangeChooserTabPage = std::make_unique<RangeChooserTabPage>(aRangeParent, *(m_apDialogModel.get()),
                                     m_apDocTemplateProvider.get(), true /* bHideDescription */ );
    TabPageParent aSeriesParent(m_xTabControl->get_page("series"), this);
    m_pDataSourceTabPage = VclPtr<DataSourceTabPage>::Create(aSeriesParent, *(m_apDialogModel.get()),
    m_xDataSourceTabPage = std::make_unique<DataSourceTabPage>(aSeriesParent, *(m_apDialogModel.get()),
                                    m_apDocTemplateProvider.get(), true /* bHideDescription */ );
    m_xTabControl->connect_enter_page(LINK(this, DataSourceDialog, ActivatePageHdl));
    m_xTabControl->connect_leave_page(LINK(this, DataSourceDialog, DeactivatePageHdl));
@@ -108,8 +106,8 @@ DataSourceDialog::DataSourceDialog(weld::Window * pParent,

DataSourceDialog::~DataSourceDialog()
{
    m_pRangeChooserTabPage.disposeAndClear();
    m_pDataSourceTabPage.disposeAndClear();
    m_xRangeChooserTabPage.reset();
    m_xDataSourceTabPage.reset();
    m_nLastPageId = m_xTabControl->get_current_page();
}

@@ -118,10 +116,10 @@ short DataSourceDialog::run()
    short nResult = GenericDialogController::run();
    if( nResult == RET_OK )
    {
        if( m_pRangeChooserTabPage )
            m_pRangeChooserTabPage->commitPage();
        if( m_pDataSourceTabPage )
            m_pDataSourceTabPage->commitPage();
        if( m_xRangeChooserTabPage )
            m_xRangeChooserTabPage->commitPage();
        if( m_xDataSourceTabPage )
            m_xDataSourceTabPage->commitPage();
    }
    return nResult;
}
@@ -129,9 +127,9 @@ short DataSourceDialog::run()
IMPL_LINK(DataSourceDialog, ActivatePageHdl, const OString&, rPage, void)
{
    if (rPage == "range")
        m_pRangeChooserTabPage->ActivatePage();
        m_xRangeChooserTabPage->Activate();
    else if (rPage == "series")
        m_pDataSourceTabPage->ActivatePage();
        m_xDataSourceTabPage->Activate();
}

// allow/disallow user to leave page
@@ -150,11 +148,11 @@ void DataSourceDialog::EnableTabToggling()
    m_bTogglingEnabled = true;
}

void DataSourceDialog::setInvalidPage( TabPage * pTabPage )
void DataSourceDialog::setInvalidPage(BuilderPage* pTabPage)
{
    if (pTabPage == m_pRangeChooserTabPage)
    if (pTabPage == m_xRangeChooserTabPage.get())
        m_bRangeChooserTabIsValid = false;
    else if (pTabPage == m_pDataSourceTabPage)
    else if (pTabPage == m_xDataSourceTabPage.get())
        m_bDataSourceTabIsValid = false;

    if (!(m_bRangeChooserTabIsValid && m_bDataSourceTabIsValid))
@@ -171,11 +169,11 @@ void DataSourceDialog::setInvalidPage( TabPage * pTabPage )
    }
}

void DataSourceDialog::setValidPage( TabPage * pTabPage )
void DataSourceDialog::setValidPage(BuilderPage* pTabPage)
{
    if( pTabPage == m_pRangeChooserTabPage )
    if( pTabPage == m_xRangeChooserTabPage.get() )
        m_bRangeChooserTabIsValid = true;
    else if( pTabPage == m_pDataSourceTabPage )
    else if( pTabPage == m_xDataSourceTabPage.get() )
        m_bDataSourceTabIsValid = true;

    if (m_bRangeChooserTabIsValid && m_bDataSourceTabIsValid)
diff --git a/chart2/source/controller/dialogs/dlg_NumberFormat.cxx b/chart2/source/controller/dialogs/dlg_NumberFormat.cxx
index 49bdc30..9be8815 100644
--- a/chart2/source/controller/dialogs/dlg_NumberFormat.cxx
+++ b/chart2/source/controller/dialogs/dlg_NumberFormat.cxx
@@ -37,9 +37,9 @@ NumberFormatDialog::NumberFormatDialog(weld::Window* pParent, SfxItemSet& rSet)
    if (fnCreatePage)
    {
        TabPageParent pPageParent(get_content_area(), this);
        VclPtr<SfxTabPage> xTabPage = (*fnCreatePage)(pPageParent, &rSet);
        std::unique_ptr<SfxTabPage> xTabPage = (*fnCreatePage)(pPageParent, &rSet);
        xTabPage->PageCreated(rSet);
        SetTabPage(xTabPage);
        SetTabPage(std::move(xTabPage));
    }
}

diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.cxx b/chart2/source/controller/dialogs/tp_AxisLabel.cxx
index 3606252..2edb5a5 100644
--- a/chart2/source/controller/dialogs/tp_AxisLabel.cxx
+++ b/chart2/source/controller/dialogs/tp_AxisLabel.cxx
@@ -69,19 +69,13 @@ SchAxisLabelTabPage::SchAxisLabelTabPage(TabPageParent pParent, const SfxItemSet

SchAxisLabelTabPage::~SchAxisLabelTabPage()
{
    disposeOnce();
}

void SchAxisLabelTabPage::dispose()
{
    m_xCtrlDial.reset();
    m_xLbTextDirection.reset();
    SfxTabPage::dispose();
}

VclPtr<SfxTabPage> SchAxisLabelTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrs)
std::unique_ptr<SfxTabPage> SchAxisLabelTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrs)
{
    return VclPtr<SchAxisLabelTabPage>::Create(pParent, *rAttrs);
    return std::make_unique<SchAxisLabelTabPage>(pParent, *rAttrs);
}

bool SchAxisLabelTabPage::FillItemSet( SfxItemSet* rOutAttrs )
diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.hxx b/chart2/source/controller/dialogs/tp_AxisLabel.hxx
index 47d52c4..1cfc7db 100644
--- a/chart2/source/controller/dialogs/tp_AxisLabel.hxx
+++ b/chart2/source/controller/dialogs/tp_AxisLabel.hxx
@@ -71,9 +71,8 @@ private:
public:
    SchAxisLabelTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
    virtual ~SchAxisLabelTabPage() override;
    virtual void dispose() override;

    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/chart2/source/controller/dialogs/tp_AxisPositions.cxx b/chart2/source/controller/dialogs/tp_AxisPositions.cxx
index 1a6248b..7dd6beb 100644
--- a/chart2/source/controller/dialogs/tp_AxisPositions.cxx
+++ b/chart2/source/controller/dialogs/tp_AxisPositions.cxx
@@ -63,12 +63,11 @@ AxisPositionsTabPage::AxisPositionsTabPage(TabPageParent pWindow,const SfxItemSe

AxisPositionsTabPage::~AxisPositionsTabPage()
{
    disposeOnce();
}

VclPtr<SfxTabPage> AxisPositionsTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs)
std::unique_ptr<SfxTabPage> AxisPositionsTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs)
{
    return VclPtr<AxisPositionsTabPage>::Create(pParent, *rOutAttrs);
    return std::make_unique<AxisPositionsTabPage>(pParent, *rOutAttrs);
}

bool AxisPositionsTabPage::FillItemSet(SfxItemSet* rOutAttrs)
diff --git a/chart2/source/controller/dialogs/tp_AxisPositions.hxx b/chart2/source/controller/dialogs/tp_AxisPositions.hxx
index 1b4f2e0..3e20edc 100644
--- a/chart2/source/controller/dialogs/tp_AxisPositions.hxx
+++ b/chart2/source/controller/dialogs/tp_AxisPositions.hxx
@@ -30,10 +30,9 @@ public:
    AxisPositionsTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
    virtual ~AxisPositionsTabPage() override;

    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;
    using TabPage::DeactivatePage;
    virtual DeactivateRC DeactivatePage( SfxItemSet* pItemSet ) override;

    void SetNumFormatter( SvNumberFormatter* pFormatter );
diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx
index 0d2e833..2decb77 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.cxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.cxx
@@ -631,7 +631,7 @@ ChartTypeTabPage::ChartTypeTabPage(TabPageParent pParent , const uno::Reference<
        m_xFT_ChooseType->hide();
    }

    SetText( SchResId(STR_PAGE_CHARTTYPE) );
    SetPageTitle(SchResId(STR_PAGE_CHARTTYPE));

    m_xMainTypeList->connect_changed(LINK(this, ChartTypeTabPage, SelectMainTypeHdl));
    m_xSubTypeList->SetSelectHdl( LINK( this, ChartTypeTabPage, SelectSubTypeHdl ) );
@@ -691,11 +691,6 @@ ChartTypeTabPage::ChartTypeTabPage(TabPageParent pParent , const uno::Reference<

ChartTypeTabPage::~ChartTypeTabPage()
{
    disposeOnce();
}

void ChartTypeTabPage::dispose()
{
    //delete all dialog controller
    m_aChartTypeDialogControllerList.clear();

@@ -707,7 +702,6 @@ void ChartTypeTabPage::dispose()
    m_pSortByXValuesResourceGroup.reset();
    m_xSubTypeListWin.reset();
    m_xSubTypeList.reset();
    vcl::OWizardPage::dispose();
}

ChartTypeParameter ChartTypeTabPage::getCurrentParamter() const
diff --git a/chart2/source/controller/dialogs/tp_ChartType.hxx b/chart2/source/controller/dialogs/tp_ChartType.hxx
index 9d299fd..8035cf7 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.hxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.hxx
@@ -49,7 +49,6 @@ public:
                , const css::uno::Reference< css::chart2::XChartDocument >& xChartModel
                , bool bShowDescription = true );
    virtual ~ChartTypeTabPage() override;
    virtual void        dispose() override;

    virtual void        initializePage() override;
    virtual bool        commitPage( ::vcl::WizardTypes::CommitPageReason eReason ) override;
diff --git a/chart2/source/controller/dialogs/tp_DataLabel.cxx b/chart2/source/controller/dialogs/tp_DataLabel.cxx
index e64e5d4..6a611a8 100644
--- a/chart2/source/controller/dialogs/tp_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/tp_DataLabel.cxx
@@ -28,9 +28,9 @@ DataLabelsTabPage::DataLabelsTabPage(TabPageParent pWindow, const SfxItemSet& rI
{
}

VclPtr<SfxTabPage> DataLabelsTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs)
std::unique_ptr<SfxTabPage> DataLabelsTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs)
{
    return VclPtr<DataLabelsTabPage>::Create(pParent, *rOutAttrs);
    return std::make_unique<DataLabelsTabPage>(pParent, *rOutAttrs);
}

bool DataLabelsTabPage::FillItemSet(SfxItemSet* rOutAttrs)
diff --git a/chart2/source/controller/dialogs/tp_DataLabel.hxx b/chart2/source/controller/dialogs/tp_DataLabel.hxx
index 48a7fbc..d5be8a1 100644
--- a/chart2/source/controller/dialogs/tp_DataLabel.hxx
+++ b/chart2/source/controller/dialogs/tp_DataLabel.hxx
@@ -32,7 +32,7 @@ class DataLabelsTabPage : public SfxTabPage
public:
    DataLabelsTabPage(TabPageParent pWindow, const SfxItemSet& rInAttrs);

    static VclPtr<SfxTabPage> Create(TabPageParent pWindow, const SfxItemSet* rInAttrs);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pWindow, const SfxItemSet* rInAttrs);

    void SetNumberFormatter( SvNumberFormatter* pFormatter );

diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx
index e1ce453..fdb8147 100644
--- a/chart2/source/controller/dialogs/tp_DataSource.cxx
+++ b/chart2/source/controller/dialogs/tp_DataSource.cxx
@@ -192,7 +192,7 @@ DataSourceTabPage::DataSourceTabPage(TabPageParent pParent, DialogModel & rDialo
    m_xFT_CAPTION->set_visible(!bHideDescription);

    m_aFixedTextRange = m_xFT_RANGE->get_label();
    SetText( SchResId( STR_OBJECT_DATASERIES_PLURAL ) );
    SetPageTitle(SchResId(STR_OBJECT_DATASERIES_PLURAL));

    // set handlers
    m_xLB_SERIES->connect_changed(LINK(this, DataSourceTabPage, SeriesSelectionChangedHdl));
@@ -237,9 +237,9 @@ DataSourceTabPage::~DataSourceTabPage()
{
}

void DataSourceTabPage::ActivatePage()
void DataSourceTabPage::Activate()
{
    OWizardPage::ActivatePage();
    OWizardPage::Activate();
    updateControlsFromDialogModel();
    m_xLB_SERIES->grab_focus();
}
@@ -248,10 +248,10 @@ void DataSourceTabPage::initializePage()
{
}

void DataSourceTabPage::DeactivatePage()
void DataSourceTabPage::Deactivate()
{
    commitPage();
    vcl::OWizardPage::DeactivatePage();
    vcl::OWizardPage::Deactivate();
}

void DataSourceTabPage::commitPage()
@@ -699,8 +699,6 @@ void DataSourceTabPage::listeningFinished(
    m_rDialogModel.getRangeSelectionHelper()->stopRangeListening();

    // change edit field
    ToTop();
    GrabFocus();
    if( m_pCurrentRangeChoosingField )
    {
        m_pCurrentRangeChoosingField->set_text(aRange);
diff --git a/chart2/source/controller/dialogs/tp_DataSource.hxx b/chart2/source/controller/dialogs/tp_DataSource.hxx
index 5386ae1..d899f76 100644
--- a/chart2/source/controller/dialogs/tp_DataSource.hxx
+++ b/chart2/source/controller/dialogs/tp_DataSource.hxx
@@ -57,7 +57,7 @@ public:
                               bool bHideDescription = false);
    virtual ~DataSourceTabPage() override;

    virtual void ActivatePage() override;
    virtual void Activate() override;

    void commitPage();

@@ -66,7 +66,7 @@ private:
    virtual bool commitPage( ::vcl::WizardTypes::CommitPageReason eReason ) override;

    //TabPage
    virtual void DeactivatePage() override;
    virtual void Deactivate() override;

    virtual void        initializePage() override;

diff --git a/chart2/source/controller/dialogs/tp_ErrorBars.cxx b/chart2/source/controller/dialogs/tp_ErrorBars.cxx
index e99452c..1b7800b 100644
--- a/chart2/source/controller/dialogs/tp_ErrorBars.cxx
+++ b/chart2/source/controller/dialogs/tp_ErrorBars.cxx
@@ -32,9 +32,9 @@ ErrorBarsTabPage::ErrorBarsTabPage(TabPageParent pParent, const SfxItemSet& rInA
{
}

VclPtr<SfxTabPage> ErrorBarsTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs)
std::unique_ptr<SfxTabPage> ErrorBarsTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs)
{
    return VclPtr<ErrorBarsTabPage>::Create(pParent, *rOutAttrs);
    return std::make_unique<ErrorBarsTabPage>(pParent, *rOutAttrs);
}

bool ErrorBarsTabPage::FillItemSet( SfxItemSet* rOutAttrs )
@@ -48,14 +48,6 @@ void ErrorBarsTabPage::Reset( const SfxItemSet* rInAttrs )
    m_aErrorBarResources.Reset( *rInAttrs );
}

void ErrorBarsTabPage::DataChanged( const DataChangedEvent& rDCEvt )
{
    SfxTabPage::DataChanged( rDCEvt );

    if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) )
        m_aErrorBarResources.FillValueSets();
}

void ErrorBarsTabPage::SetAxisMinorStepWidthForErrorBarDecimals( double fMinorStepWidth )
{
    m_aErrorBarResources.SetAxisMinorStepWidthForErrorBarDecimals( fMinorStepWidth );
diff --git a/chart2/source/controller/dialogs/tp_ErrorBars.hxx b/chart2/source/controller/dialogs/tp_ErrorBars.hxx
index 337b58f..e74aac0 100644
--- a/chart2/source/controller/dialogs/tp_ErrorBars.hxx
+++ b/chart2/source/controller/dialogs/tp_ErrorBars.hxx
@@ -36,12 +36,10 @@ public:
    void SetChartDocumentForRangeChoosing(
        const css::uno::Reference< css::chart2::XChartDocument > & xChartDocument );

    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;

    virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;

private:
    ErrorBarResources   m_aErrorBarResources;
};
diff --git a/chart2/source/controller/dialogs/tp_LegendPosition.cxx b/chart2/source/controller/dialogs/tp_LegendPosition.cxx
index efd8a29..e7a855c 100644
--- a/chart2/source/controller/dialogs/tp_LegendPosition.cxx
+++ b/chart2/source/controller/dialogs/tp_LegendPosition.cxx
@@ -35,19 +35,12 @@ SchLegendPosTabPage::SchLegendPosTabPage(TabPageParent pWindow, const SfxItemSet

SchLegendPosTabPage::~SchLegendPosTabPage()
{
    disposeOnce();
}

void SchLegendPosTabPage::dispose()
{
    m_xLbTextDirection.reset();
    SfxTabPage::dispose();
}


VclPtr<SfxTabPage> SchLegendPosTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs)
std::unique_ptr<SfxTabPage> SchLegendPosTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs)
{
    return VclPtr<SchLegendPosTabPage>::Create(pParent, *rOutAttrs);
    return std::make_unique<SchLegendPosTabPage>(pParent, *rOutAttrs);
}

bool SchLegendPosTabPage::FillItemSet(SfxItemSet* rOutAttrs)
diff --git a/chart2/source/controller/dialogs/tp_LegendPosition.hxx b/chart2/source/controller/dialogs/tp_LegendPosition.hxx
index 3e48cd9..4414be65 100644
--- a/chart2/source/controller/dialogs/tp_LegendPosition.hxx
+++ b/chart2/source/controller/dialogs/tp_LegendPosition.hxx
@@ -38,9 +38,8 @@ private:
public:
    SchLegendPosTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
    virtual ~SchLegendPosTabPage() override;
    virtual void dispose() override;

    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/chart2/source/controller/dialogs/tp_PointGeometry.cxx b/chart2/source/controller/dialogs/tp_PointGeometry.cxx
index 2cbfe65..6e667b9 100644
--- a/chart2/source/controller/dialogs/tp_PointGeometry.cxx
+++ b/chart2/source/controller/dialogs/tp_PointGeometry.cxx
@@ -36,18 +36,12 @@ SchLayoutTabPage::SchLayoutTabPage(TabPageParent pParent, const SfxItemSet& rInA

SchLayoutTabPage::~SchLayoutTabPage()
{
    disposeOnce();
}

void SchLayoutTabPage::dispose()
{
    m_pGeometryResources.reset();
    SfxTabPage::dispose();
}

VclPtr<SfxTabPage> SchLayoutTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs)
std::unique_ptr<SfxTabPage> SchLayoutTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs)
{
    return VclPtr<SchLayoutTabPage>::Create(pParent, *rOutAttrs);
    return std::make_unique<SchLayoutTabPage>(pParent, *rOutAttrs);
}

bool SchLayoutTabPage::FillItemSet(SfxItemSet* rOutAttrs)
diff --git a/chart2/source/controller/dialogs/tp_PointGeometry.hxx b/chart2/source/controller/dialogs/tp_PointGeometry.hxx
index 4690a1f..680f330 100644
--- a/chart2/source/controller/dialogs/tp_PointGeometry.hxx
+++ b/chart2/source/controller/dialogs/tp_PointGeometry.hxx
@@ -30,9 +30,8 @@ class SchLayoutTabPage : public SfxTabPage
public:
    SchLayoutTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
    virtual ~SchLayoutTabPage() override;
    virtual void dispose() override;

    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/chart2/source/controller/dialogs/tp_PolarOptions.cxx b/chart2/source/controller/dialogs/tp_PolarOptions.cxx
index 0cd66b0..f98fc07 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.cxx
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.cxx
@@ -40,18 +40,12 @@ PolarOptionsTabPage::PolarOptionsTabPage(TabPageParent pWindow, const SfxItemSet

PolarOptionsTabPage::~PolarOptionsTabPage()
{
    disposeOnce();
}

void PolarOptionsTabPage::dispose()
{
    m_xAngleDial.reset();
    SfxTabPage::dispose();
}

VclPtr<SfxTabPage> PolarOptionsTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs)
std::unique_ptr<SfxTabPage> PolarOptionsTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs)
{
    return VclPtr<PolarOptionsTabPage>::Create(pParent, *rOutAttrs);
    return std::make_unique<PolarOptionsTabPage>(pParent, *rOutAttrs);
}

bool PolarOptionsTabPage::FillItemSet( SfxItemSet* rOutAttrs )
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.hxx b/chart2/source/controller/dialogs/tp_PolarOptions.hxx
index a789c4f..f962f94 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.hxx
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.hxx
@@ -38,9 +38,8 @@ class PolarOptionsTabPage : public SfxTabPage
public:
    PolarOptionsTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
    virtual ~PolarOptionsTabPage() override;
    virtual void dispose() override;

    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/chart2/source/controller/dialogs/tp_RangeChooser.cxx b/chart2/source/controller/dialogs/tp_RangeChooser.cxx
index e0f0338..ecbc658 100644
--- a/chart2/source/controller/dialogs/tp_RangeChooser.cxx
+++ b/chart2/source/controller/dialogs/tp_RangeChooser.cxx
@@ -87,7 +87,7 @@ RangeChooserTabPage::RangeChooserTabPage(TabPageParent pParent, DialogModel & rD
{
    m_xFT_Caption->set_visible(!bHideDescription);

    SetText(m_xFTTitle->get_label());// OH:remove later with dialog
    SetPageTitle(m_xFTTitle->get_label());// OH:remove later with dialog

    // set defaults as long as DetectArguments does not work
    m_xRB_Columns->set_active(true);
@@ -126,9 +126,9 @@ RangeChooserTabPage::~RangeChooserTabPage()
{
}

void RangeChooserTabPage::ActivatePage()
void RangeChooserTabPage::Activate()
{
    OWizardPage::ActivatePage();
    OWizardPage::Activate();
    initControlsFromModel();
    m_xED_Range->grab_focus();
}
@@ -163,10 +163,10 @@ void RangeChooserTabPage::initControlsFromModel()
    m_nChangingControlCalls--;
}

void RangeChooserTabPage::DeactivatePage()
void RangeChooserTabPage::Deactivate()
{
    commitPage();
    vcl::OWizardPage::DeactivatePage();
    vcl::OWizardPage::Deactivate();
}

void RangeChooserTabPage::commitPage()
@@ -357,8 +357,6 @@ void RangeChooserTabPage::listeningFinished( const OUString & rNewRange )
    m_rDialogModel.getRangeSelectionHelper()->stopRangeListening();

    //update dialog state
    ToTop();
    GrabFocus();
    m_xED_Range->set_text(aRange);
    m_xED_Range->grab_focus();

@@ -368,6 +366,7 @@ void RangeChooserTabPage::listeningFinished( const OUString & rNewRange )

    lcl_enableRangeChoosing( false, m_pParentController );
}

void RangeChooserTabPage::disposingRangeSelection()
{
    m_rDialogModel.getRangeSelectionHelper()->stopRangeListening( false );
diff --git a/chart2/source/controller/dialogs/tp_RangeChooser.hxx b/chart2/source/controller/dialogs/tp_RangeChooser.hxx
index d630fc59..41ae6f1 100644
--- a/chart2/source/controller/dialogs/tp_RangeChooser.hxx
+++ b/chart2/source/controller/dialogs/tp_RangeChooser.hxx
@@ -46,7 +46,7 @@ public:
    virtual void listeningFinished( const OUString & rNewRange ) override;
    virtual void disposingRangeSelection() override;

    virtual void ActivatePage() override;
    virtual void Activate() override;

    void commitPage();

@@ -56,7 +56,7 @@ private:
    virtual bool commitPage( ::vcl::WizardTypes::CommitPageReason eReason ) override;

    //TabPage
    virtual void DeactivatePage() override;
    virtual void Deactivate() override;

    void initControlsFromModel();
    void changeDialogModelAccordingToControls();
diff --git a/chart2/source/controller/dialogs/tp_Scale.cxx b/chart2/source/controller/dialogs/tp_Scale.cxx
index 100b115..e7f5837 100644
--- a/chart2/source/controller/dialogs/tp_Scale.cxx
+++ b/chart2/source/controller/dialogs/tp_Scale.cxx
@@ -111,7 +111,6 @@ ScaleTabPage::ScaleTabPage(TabPageParent pWindow,const SfxItemSet& rInAttrs)

ScaleTabPage::~ScaleTabPage()
{
    disposeOnce();
}

void ScaleTabPage::EnableControls()
@@ -214,9 +213,9 @@ IMPL_LINK_NOARG(ScaleTabPage, SelectAxisTypeHdl, weld::ComboBox&, void)
    SetNumFormat();
}

VclPtr<SfxTabPage> ScaleTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs)
std::unique_ptr<SfxTabPage> ScaleTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs)
{
    return VclPtr<ScaleTabPage>::Create(pParent, *rOutAttrs);
    return std::make_unique<ScaleTabPage>(pParent, *rOutAttrs);
}

bool ScaleTabPage::FillItemSet(SfxItemSet* rOutAttrs)
@@ -559,7 +558,7 @@ bool ScaleTabPage::ShowWarning(const char* pResIdMessage, weld::Widget* pControl
    if (pResIdMessage == nullptr)
        return false;

    std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(GetFrameWeld(),
    std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(GetDialogFrameWeld(),
                                               VclMessageType::Warning, VclButtonsType::Ok,
                                               SchResId(pResIdMessage)));
    xWarn->run();
diff --git a/chart2/source/controller/dialogs/tp_Scale.hxx b/chart2/source/controller/dialogs/tp_Scale.hxx
index a44c12c..09c47af 100644
--- a/chart2/source/controller/dialogs/tp_Scale.hxx
+++ b/chart2/source/controller/dialogs/tp_Scale.hxx
@@ -30,10 +30,9 @@ public:
    ScaleTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
    virtual ~ScaleTabPage() override;

    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;
    using TabPage::DeactivatePage;
    virtual DeactivateRC DeactivatePage( SfxItemSet* pItemSet ) override;

    void SetNumFormatter( SvNumberFormatter* pFormatter );
diff --git a/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx b/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
index b84ee44..db5a0cf 100644
--- a/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
+++ b/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
@@ -58,7 +58,6 @@ SchOptionTabPage::SchOptionTabPage(TabPageParent pWindow,const SfxItemSet& rInAt

SchOptionTabPage::~SchOptionTabPage()
{
    disposeOnce();
}

IMPL_LINK_NOARG(SchOptionTabPage, EnableHdl, weld::ToggleButton&, void)
@@ -69,10 +68,10 @@ IMPL_LINK_NOARG(SchOptionTabPage, EnableHdl, weld::ToggleButton&, void)
        m_xCBAxisSideBySide->set_sensitive( m_xRbtAxis1->get_active());
}

VclPtr<SfxTabPage> SchOptionTabPage::Create(TabPageParent pParent,
std::unique_ptr<SfxTabPage> SchOptionTabPage::Create(TabPageParent pParent,
                                            const SfxItemSet* rOutAttrs)
{
    return VclPtr<SchOptionTabPage>::Create(pParent, *rOutAttrs);
    return std::make_unique<SchOptionTabPage>(pParent, *rOutAttrs);
}

bool SchOptionTabPage::FillItemSet(SfxItemSet* rOutAttrs)
diff --git a/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx b/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx
index 7ffbed7..2538a6b 100644
--- a/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx
+++ b/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx
@@ -38,7 +38,7 @@ public:
    SchOptionTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
    virtual ~SchOptionTabPage() override;

    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/chart2/source/controller/dialogs/tp_TitleRotation.cxx b/chart2/source/controller/dialogs/tp_TitleRotation.cxx
index b9d73f3..f8748a0 100644
--- a/chart2/source/controller/dialogs/tp_TitleRotation.cxx
+++ b/chart2/source/controller/dialogs/tp_TitleRotation.cxx
@@ -69,26 +69,20 @@ IMPL_LINK_NOARG(SchAlignmentTabPage, StackedToggleHdl, weld::ToggleButton&, void

SchAlignmentTabPage::~SchAlignmentTabPage()
{
    disposeOnce();
}

void SchAlignmentTabPage::dispose()
{
    m_xCtrlDial.reset();
    m_xLbTextDirection.reset();
    SfxTabPage::dispose();
}

VclPtr<SfxTabPage> SchAlignmentTabPage::Create(TabPageParent pParent,
std::unique_ptr<SfxTabPage> SchAlignmentTabPage::Create(TabPageParent pParent,
                                               const SfxItemSet* rInAttrs)
{
    return VclPtr<SchAlignmentTabPage>::Create(pParent, *rInAttrs);
    return std::make_unique<SchAlignmentTabPage>(pParent, *rInAttrs);
}

VclPtr<SfxTabPage> SchAlignmentTabPage::CreateWithoutRotation(TabPageParent pParent,
std::unique_ptr<SfxTabPage> SchAlignmentTabPage::CreateWithoutRotation(TabPageParent pParent,
                                                              const SfxItemSet* rInAttrs)
{
    return VclPtr<SchAlignmentTabPage>::Create(pParent, *rInAttrs, false);
    return std::make_unique<SchAlignmentTabPage>(pParent, *rInAttrs, false);
}

bool SchAlignmentTabPage::FillItemSet(SfxItemSet* rOutAttrs)
diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.hxx b/chart2/source/controller/dialogs/tp_TitleRotation.hxx
index 9368a41..ae1e398 100644
--- a/chart2/source/controller/dialogs/tp_TitleRotation.hxx
+++ b/chart2/source/controller/dialogs/tp_TitleRotation.hxx
@@ -51,10 +51,9 @@ private:
public:
    SchAlignmentTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs, bool bWithRotation = true);
    virtual ~SchAlignmentTabPage() override;
    virtual void dispose() override;

    static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rInAttrs);
    static VclPtr<SfxTabPage> CreateWithoutRotation(TabPageParent pParent, const SfxItemSet* rInAttrs);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rInAttrs);
    static std::unique_ptr<SfxTabPage> CreateWithoutRotation(TabPageParent pParent, const SfxItemSet* rInAttrs);
    virtual bool FillItemSet(SfxItemSet* rOutAttrs) override;
    virtual void Reset(const SfxItemSet* rInAttrs) override;
};
diff --git a/chart2/source/controller/dialogs/tp_Trendline.cxx b/chart2/source/controller/dialogs/tp_Trendline.cxx
index fcbecd9..f21ca36 100644
--- a/chart2/source/controller/dialogs/tp_Trendline.cxx
+++ b/chart2/source/controller/dialogs/tp_Trendline.cxx
@@ -30,9 +30,9 @@ TrendlineTabPage::TrendlineTabPage(TabPageParent pParent, const SfxItemSet& rInA
{
}

VclPtr<SfxTabPage> TrendlineTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs)
std::unique_ptr<SfxTabPage> TrendlineTabPage::Create(TabPageParent pParent, const SfxItemSet* rOutAttrs)
{
    return VclPtr<TrendlineTabPage>::Create(pParent, *rOutAttrs);
    return std::make_unique<TrendlineTabPage>(pParent, *rOutAttrs);
}

bool TrendlineTabPage::FillItemSet( SfxItemSet* rOutAttrs )
@@ -46,14 +46,6 @@ void TrendlineTabPage::Reset( const SfxItemSet* rInAttrs )
    m_aTrendlineResources.Reset( *rInAttrs );
}

void TrendlineTabPage::DataChanged( const DataChangedEvent& rDCEvt )
{
    SfxTabPage::DataChanged( rDCEvt );

    if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) )
        m_aTrendlineResources.FillValueSets();
}

void TrendlineTabPage::SetNumFormatter( SvNumberFormatter* pNumFormatter )
{
    m_aTrendlineResources.SetNumFormatter( pNumFormatter );
diff --git a/chart2/source/controller/dialogs/tp_Trendline.hxx b/chart2/source/controller/dialogs/tp_Trendline.hxx
index 03dd251..2d825be 100644
--- a/chart2/source/controller/dialogs/tp_Trendline.hxx
+++ b/chart2/source/controller/dialogs/tp_Trendline.hxx
@@ -31,11 +31,10 @@ class TrendlineTabPage : public SfxTabPage
public:
    TrendlineTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);

    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;

    virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
    void SetNumFormatter( SvNumberFormatter* pFormatter );
    void SetNbPoints( sal_Int32 nNbPoints );

diff --git a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx
index 24b6d50..c8a2ee1 100644
--- a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx
+++ b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx
@@ -54,7 +54,6 @@ TitlesAndObjectsTabPage::TitlesAndObjectsTabPage(TabPageParent pParent,

TitlesAndObjectsTabPage::~TitlesAndObjectsTabPage()
{
    disposeOnce();
}

void TitlesAndObjectsTabPage::initializePage()
diff --git a/chart2/source/controller/inc/TabPageNotifiable.hxx b/chart2/source/controller/inc/TabPageNotifiable.hxx
index 01e7b49..d9ba555 100644
--- a/chart2/source/controller/inc/TabPageNotifiable.hxx
+++ b/chart2/source/controller/inc/TabPageNotifiable.hxx
@@ -24,7 +24,7 @@
// color to use as background for an invalid range
#define RANGE_SELECTION_INVALID_RANGE_BACKGROUND_COLOR Color(0xff6563)

class TabPage;
class BuilderPage;

namespace chart
{
@@ -32,8 +32,8 @@ namespace chart
class TabPageNotifiable
{
public:
    virtual void setInvalidPage( TabPage * pTabPage ) = 0;
    virtual void setValidPage( TabPage * pTabPage ) = 0;
    virtual void setInvalidPage( BuilderPage * pTabPage ) = 0;
    virtual void setValidPage( BuilderPage * pTabPage ) = 0;

protected:
    ~TabPageNotifiable() {}
diff --git a/chart2/source/controller/inc/dlg_ChartType.hxx b/chart2/source/controller/inc/dlg_ChartType.hxx
index 7483dcd..3b01f54b 100644
--- a/chart2/source/controller/inc/dlg_ChartType.hxx
+++ b/chart2/source/controller/inc/dlg_ChartType.hxx
@@ -37,7 +37,7 @@ public:
private:
    css::uno::Reference<css::frame::XModel> m_xChartModel;
    std::unique_ptr<weld::Container> m_xContentArea;
    VclPtr<ChartTypeTabPage> m_xChartTypeTabPage;
    std::unique_ptr<ChartTypeTabPage> m_xChartTypeTabPage;
};

} //namespace chart
diff --git a/chart2/source/controller/inc/dlg_CreationWizard.hxx b/chart2/source/controller/inc/dlg_CreationWizard.hxx
index ae50675..e605105 100644
--- a/chart2/source/controller/inc/dlg_CreationWizard.hxx
+++ b/chart2/source/controller/inc/dlg_CreationWizard.hxx
@@ -50,8 +50,8 @@ public:
    virtual ~CreationWizard() override;

    // TabPageNotifiable
    virtual void setInvalidPage(TabPage * pTabPage) override;
    virtual void setValidPage(TabPage * pTabPage) override;
    virtual void setInvalidPage(BuilderPage * pTabPage) override;
    virtual void setValidPage(BuilderPage * pTabPage) override;

protected:
    virtual bool leaveState( WizardState _nState ) override;
@@ -61,7 +61,7 @@ protected:
    virtual OUString getStateDisplayName(WizardState nState) const override;

private:
    virtual VclPtr<TabPage> createPage(WizardState nState) override;
    virtual std::unique_ptr<BuilderPage> createPage(WizardState nState) override;

    css::uno::Reference<css::chart2::XChartDocument> m_xChartModel;
    css::uno::Reference<css::uno::XComponentContext> m_xComponentContext;
diff --git a/chart2/source/controller/inc/dlg_DataSource.hxx b/chart2/source/controller/inc/dlg_DataSource.hxx
index b708a2c..680256d 100644
--- a/chart2/source/controller/inc/dlg_DataSource.hxx
+++ b/chart2/source/controller/inc/dlg_DataSource.hxx
@@ -29,7 +29,7 @@ namespace com { namespace sun { namespace star { namespace uno { class XComponen

#include <memory>

class TabPage;
class BuilderPage;

namespace chart
{
@@ -54,8 +54,8 @@ public:
    virtual short run() override;

    // TabPageNotifiable
    virtual void setInvalidPage( TabPage * pTabPage ) override;
    virtual void setValidPage( TabPage * pTabPage ) override;
    virtual void setInvalidPage( BuilderPage * pTabPage ) override;
    virtual void setValidPage( BuilderPage * pTabPage ) override;

private:
    void DisableTabToggling();
@@ -67,8 +67,8 @@ private:
    std::unique_ptr< ChartTypeTemplateProvider >  m_apDocTemplateProvider;
    std::unique_ptr< DialogModel >                m_apDialogModel;

    VclPtr<RangeChooserTabPage> m_pRangeChooserTabPage;
    VclPtr<DataSourceTabPage>   m_pDataSourceTabPage;
    std::unique_ptr<RangeChooserTabPage> m_xRangeChooserTabPage;
    std::unique_ptr<DataSourceTabPage> m_xDataSourceTabPage;
    bool                  m_bRangeChooserTabIsValid;
    bool                  m_bDataSourceTabIsValid;
    bool                  m_bTogglingEnabled;
diff --git a/cui/source/customize/SvxMenuConfigPage.cxx b/cui/source/customize/SvxMenuConfigPage.cxx
index d68582f7..08fb276 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 521aafc..5c439ab 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 ff63843..39de9ba 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 3437ca7..2cdca48 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 def9839..0246f66 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 44ff4f9..155708a 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 4a608f6..d7d0054 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 d504328..360effa 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 54d7894..b7fdc64 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 309428d..78061d9 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 c7e86e6..a4998e9 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 e61fe51..c351274 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 063d5b1..69ae8ea 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 8d2c9ea..61a239b 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);

    OfaSwAutoFmtOptionsPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual ~OfaSwAutoFmtOptionsPage() override;
    virtual void dispose() override;

public:
    static VclPtr<SfxTabPage>  Create( TabPageParent pParent,
    OfaSwAutoFmtOptionsPage(TabPageParent pParent, const SfxItemSet& rSet);
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent,
                            const SfxItemSet* rAttrSet);
    virtual ~OfaSwAutoFmtOptionsPage() override;

    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 0999977..86d52da 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 92790ea..30e2ad5 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 4b4e308..eeb7644 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 68e6879..8d98176 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 70e54e6..d89fa45 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 064bc66..751557c 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 204cab1..64c1526 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 08b1818..fc16a4a 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 652e38b..368090d 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 305c6b3..ae42ecc 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 b177fb3..dc3d9d1 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 f1e7dbe..7e3987a 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 9843e32..1294c2c 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 07d802a7..267d4b8 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 0ad8c48..07ed15d 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 8cb4e54..145463f 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 9cca6a3..58a38e8 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 cbce3ff..b822cd36 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 3910941..fffe71e 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 1aaeafa..ab38e03 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 b214115..e0740cf 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 1082f135..7dd36f6 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 a52ca0c..3448d857 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 35a9bea..3df98a5b 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 4f5c276..d02d915a 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 a0c8e7c..38c95d2 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 ecc725e..b5b2ae4 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 42b998a..0cc80c9 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 0d7b6fe..f90b731 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 139bd2b..6f6449b 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 37bb037..41acf9c 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 25ada3e..08682ef 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 d02b0b1..a58819d 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 b7ffaea..c308dd7 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 4f33ab2..a250a80 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 47b4443..a251ea8 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 5a1ed1b..5f00ec3 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 ef167d2..2b053e3 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 328d326..4563ed3 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 5114e8c..63f2fed 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 116ff56..2f69381 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 fca6bec..8a0da42 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 39317f0..828ecfd 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 497a4f4..a3b6349 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 e9e88d2..35a207b 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 54dc5f7..f92cbcd 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 5d35c07..0a07a4b 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 e619ecc..a4e9edd 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 ff1e2a7..2568d90 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 b125622..e32b65e 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 39bc71e..55068ff 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 15edb46..8b8c07c26 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 e815f07..f0b26e7 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 53fc71f..71df2ed 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 44e9be0..1abc8a0 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 676ce16..2e8fccf 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 ad84b0d..fec960a 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 f325ae1..b110ad1 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 74164f8..526b1f4 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 8b194bd..9f30b60 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 8a393d0..35f7264 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 ddb74e0..c9a7353 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 f8aeaf5..5f02636 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 65054a4..14cc52f 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 412adae..fd8b037 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 978a676..5d08598 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 ff126c4..5c7b3fb 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 8767c85..a3f9051 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 9317041..a045059e 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 b9f78c6..e484d9a 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;
    pNewPage = pPageInfo->m_xPage.get();

    // 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();

    //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 2360efd..91fbd29 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 5fa49a1..ff60956 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 d033764..fd2b034 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 4ff40e1..375d8b3 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 b66ef21..548b77a 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 2228315..b64ea93 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 30a42e9..de3ca43 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 7defa0a2..a903021 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 8b60ac8..7480e48 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 cabe3bb..e2ea708 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 63eeb1a..9ca74cf 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 1e0493a..d8a9fee 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 902dd01..093debd 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 f3df9bc..75c9630 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 9ab9b526..b4299d7 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 35e4ae4..0e6a3a0 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 8d44830..71eb7ff 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 ecd5afd..3a20a1e 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 0b576d4..579c2b0 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 ae15bf6..44f9864 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 39f6a39..64ac9d6 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 1f7abce1..936a1b8 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 fee60f8..3a5733f 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 dc15253..88fc1f5 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 56b9294..00e2e4e 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 e838812..4ed54c7 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 b146fec..3d108c8 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 7c1d713..e4770e0 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 a64b108..b5e9c18 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 3892632..495135a 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 551509d..06e9c2c 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 )
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
index 7a6901c..72fe9b8 100644
--- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
@@ -42,10 +42,12 @@
#include "dsselect.hxx"
#include <svl/filenotation.hxx>
#include <stringconstants.hxx>
#include <com/sun/star/awt/XSystemDependentWindowPeer.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/ui/dialogs/FolderPicker.hpp>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/lang/SystemDependent.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/mozilla/MozillaBootstrap.hpp>
#include <com/sun/star/task/InteractionHandler.hpp>
#include <com/sun/star/ucb/XProgressHandler.hpp>
@@ -57,6 +59,7 @@
#include <connectivity/CommonTools.hxx>
#include <tools/urlobj.hxx>
#include <tools/diagnose_ex.h>
#include <rtl/process.h>
#include <sfx2/docfilt.hxx>

#if defined _WIN32
@@ -106,12 +109,7 @@ namespace dbaui

    OConnectionHelper::~OConnectionHelper()
    {
    }

    void OConnectionHelper::dispose()
    {
        m_xConnectionURL.reset();
        OGenericAdministrationPage::dispose();
    }

    void OConnectionHelper::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
@@ -215,7 +213,7 @@ namespace dbaui
                    ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION,
                    FileDialogFlags::NONE,
                    aModule.GetFactoryEmptyDocumentURL(SvtModuleOptions::EFactory::CALC)
                    ,SfxFilterFlags::IMPORT, SfxFilterFlags::NONE, GetFrameWeld());
                    ,SfxFilterFlags::IMPORT, SfxFilterFlags::NONE, GetDialogFrameWeld());
                askForFileName(aFileDlg);
            }
            break;
@@ -226,7 +224,7 @@ namespace dbaui
                    ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION,
                    FileDialogFlags::NONE,
                    aModule.GetFactoryEmptyDocumentURL(SvtModuleOptions::EFactory::WRITER),
                    SfxFilterFlags::IMPORT, SfxFilterFlags::NONE, GetFrameWeld());
                    SfxFilterFlags::IMPORT, SfxFilterFlags::NONE, GetDialogFrameWeld());
                askForFileName(aFileDlg);
            }
            break;
@@ -236,7 +234,7 @@ namespace dbaui
                OUString sFilterName(DBA_RES (STR_MSACCESS_FILTERNAME));
                ::sfx2::FileDialogHelper aFileDlg(
                    ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION,
                    FileDialogFlags::NONE, GetFrameWeld());
                    FileDialogFlags::NONE, GetDialogFrameWeld());
                aFileDlg.AddFilter(sFilterName,sExt);
                aFileDlg.SetCurrentFilter(sFilterName);
                askForFileName(aFileDlg);
@@ -248,7 +246,7 @@ namespace dbaui
                OUString sFilterName2(DBA_RES (STR_MSACCESS_2007_FILTERNAME));
                ::sfx2::FileDialogHelper aFileDlg(
                    ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION,
                    FileDialogFlags::NONE, GetFrameWeld());
                    FileDialogFlags::NONE, GetDialogFrameWeld());
                aFileDlg.AddFilter(sFilterName2,sAccdb);
                aFileDlg.SetCurrentFilter(sFilterName2);
                askForFileName(aFileDlg);
@@ -275,7 +273,20 @@ namespace dbaui
            {
                OUString sOldDataSource=getURLNoPrefix();
                OUString sNewDataSource;
                HWND hWnd = GetParent()->GetSystemData()->hWnd;
                HWND hWnd = 0;

                weld::Window* pDialog = GetDialogFrameWeld();
                css::uno::Reference<css::awt::XSystemDependentWindowPeer> xSysDepWin(pDialog->GetXWindow(), css::uno::UNO_QUERY);
                if (xSysDepWin.is())
                {
                    css::uno::Sequence<sal_Int8> aProcessIdent(16);
                    rtl_getGlobalProcessId(reinterpret_cast<sal_uInt8*>(aProcessIdent.getArray()));
                    css::uno::Any aAny = xSysDepWin->getWindowHandle(aProcessIdent, css::lang::SystemDependent::SYSTEM_WIN32);
                    sal_Int64 tmp(0);
                    aAny >>= tmp;
                    hWnd = reinterpret_cast<HWND>(tmp);
                }

                sNewDataSource = getAdoDatalink(reinterpret_cast<LONG_PTR>(hWnd),sOldDataSource);
                if ( !sNewDataSource.isEmpty() )
                {
@@ -283,8 +294,6 @@ namespace dbaui
                    SetRoadmapStateValue(true);
                    callModifiedHdl();
                }
                else
                    return;
            }
            break;
#endif
@@ -311,7 +320,7 @@ namespace dbaui
                    aProfiles.insert(pArray[index]);

                // execute the select dialog
                ODatasourceSelectDialog aSelector(GetFrameWeld(), aProfiles);
                ODatasourceSelectDialog aSelector(GetDialogFrameWeld(), aProfiles);
                OUString sOldProfile=getURLNoPrefix();

                if (!sOldProfile.isEmpty())
@@ -329,7 +338,7 @@ namespace dbaui
                OUString sFilterName(DBA_RES (STR_FIREBIRD_FILTERNAME));
                ::sfx2::FileDialogHelper aFileDlg(
                    ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
                    FileDialogFlags::NONE, GetFrameWeld());
                    FileDialogFlags::NONE, GetDialogFrameWeld());
                aFileDlg.AddFilter(sFilterName,sExt);
                aFileDlg.SetCurrentFilter(sFilterName);
                askForFileName(aFileDlg);
@@ -354,7 +363,7 @@ namespace dbaui
                OUString sFilterName(DBA_RES (STR_FIREBIRD_FILTERNAME));
                ::sfx2::FileDialogHelper aFileDlg(
                    ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION,
                    FileDialogFlags::NONE, GetFrameWeld());
                    FileDialogFlags::NONE, GetDialogFrameWeld());
                aFileDlg.AddFilter(sFilterName,sExt);
                aFileDlg.SetCurrentFilter(sFilterName);
                askForFileName(aFileDlg);
@@ -470,8 +479,7 @@ namespace dbaui
            sQuery = sQuery.replaceFirst("$path$", aTransformer.get(OFileNotation::N_SYSTEM));

            m_bUserGrabFocus = false;
            vcl::Window* pWin = GetParent();
            std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
            std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetDialogFrameWeld(),
                                                           VclMessageType::Question, VclButtonsType::YesNo,
                                                           sQuery));
            xQueryBox->set_default_response(RET_YES);
@@ -492,7 +500,7 @@ namespace dbaui

                            m_bUserGrabFocus = false;

                            std::unique_ptr<weld::MessageDialog> xWhatToDo(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
                            std::unique_ptr<weld::MessageDialog> xWhatToDo(Application::CreateMessageDialog(GetDialogFrameWeld(),
                                                                           VclMessageType::Question, VclButtonsType::NONE,
                                                                           sQuery));
                            xWhatToDo->add_button(GetStandardText(StandardButtonType::Retry), RET_RETRY);
@@ -680,7 +688,7 @@ namespace dbaui
                    {
                        OUString sFile = DBA_RES( STR_FILE_DOES_NOT_EXIST );
                        sFile = sFile.replaceFirst("$file$", aTransformer.get(OFileNotation::N_SYSTEM));
                        OSQLWarningBox aWarning(GetFrameWeld(), sFile);
                        OSQLWarningBox aWarning(GetDialogFrameWeld(), sFile);
                        aWarning.run();
                        setURLNoPrefix(sOldPath);
                        SetRoadmapStateValue(false);
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.hxx b/dbaccess/source/ui/dlg/ConnectionHelper.hxx
index 094d933..9d38e1d 100644
--- a/dbaccess/source/ui/dlg/ConnectionHelper.hxx
+++ b/dbaccess/source/ui/dlg/ConnectionHelper.hxx
@@ -42,7 +42,6 @@ namespace dbaui
    public:
        OConnectionHelper(TabPageParent pParent, const OUString& _rUIXMLDescription, const OString& _rId, const SfxItemSet& _rCoreAttrs);
        virtual ~OConnectionHelper() override;
        virtual void dispose() override;

        OUString     m_eType;          // the type can't be changed in this class, so we hold it as member.
        // setting/retrieving the current connection URL
diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx
index 0138f3d..e9618fe 100644
--- a/dbaccess/source/ui/dlg/ConnectionPage.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx
@@ -76,9 +76,9 @@ namespace dbaui
    using namespace ::dbtools;
    using namespace ::svt;

    VclPtr<SfxTabPage> OConnectionTabPage::Create(TabPageParent pParent, const SfxItemSet* _rAttrSet)
    std::unique_ptr<SfxTabPage> OConnectionTabPage::Create(TabPageParent pParent, const SfxItemSet* _rAttrSet)
    {
        return VclPtr<OConnectionTabPage>::Create(pParent, *_rAttrSet);
        return std::make_unique<OConnectionTabPage>(pParent, *_rAttrSet);
    }

    // OConnectionTabPage
@@ -105,7 +105,6 @@ namespace dbaui

    OConnectionTabPage::~OConnectionTabPage()
    {
        disposeOnce();
    }

    void OConnectionTabPage::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
@@ -285,7 +284,7 @@ namespace dbaui

        const char* pMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
        const MessageType mt = bSuccess ? MessageType::Info : MessageType::Error;
        OSQLMessageBox aMsg(GetFrameWeld(), DBA_RES(pMessage), OUString(), MessBoxStyle::Ok | MessBoxStyle::DefaultOk, mt);
        OSQLMessageBox aMsg(GetDialogFrameWeld(), DBA_RES(pMessage), OUString(), MessBoxStyle::Ok | MessBoxStyle::DefaultOk, mt);
        aMsg.run();
    }
    bool OConnectionTabPage::checkTestConnection()
diff --git a/dbaccess/source/ui/dlg/ConnectionPage.hxx b/dbaccess/source/ui/dlg/ConnectionPage.hxx
index 2d09046..8ce5e10 100644
--- a/dbaccess/source/ui/dlg/ConnectionPage.hxx
+++ b/dbaccess/source/ui/dlg/ConnectionPage.hxx
@@ -34,7 +34,6 @@ namespace dbaui
    */
    class OConnectionTabPage final : public OConnectionHelper
    {
        friend class VclPtr<OConnectionTabPage>;
    private:
        // user authentication
        std::unique_ptr<weld::Label> m_xFL2;
@@ -56,8 +55,9 @@ namespace dbaui
        DECL_LINK(OnEditModified, weld::Entry&, void);

    public:
        OConnectionTabPage(TabPageParent pParent, const SfxItemSet& _rCoreAttrs);
        static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* _rAttrSet);
        virtual ~OConnectionTabPage() override;
        static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* _rAttrSet );
        virtual bool        FillItemSet (SfxItemSet* _rCoreAttrs) override;

        virtual void        implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
@@ -67,9 +67,6 @@ namespace dbaui
            affect the type may be changed (compared to the previous URL).</p>
        */
    private:
        OConnectionTabPage(TabPageParent pParent, const SfxItemSet& _rCoreAttrs);
            // nControlFlags is a combination of the CBTP_xxx-constants

        /** enables the test connection button, if allowed
        */
        virtual bool checkTestConnection() override;
diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
index 5052ed5..141f81f 100644
--- a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
@@ -61,29 +61,29 @@ namespace dbaui
    using namespace ::dbtools;
    using namespace ::svt;

    VclPtr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateDbaseTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet)
    std::unique_ptr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateDbaseTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet)
    {
        return VclPtr<OConnectionTabPageSetup>::Create ( pParent, "dbaccess/ui/dbwizconnectionpage.ui", "ConnectionPage", _rAttrSet, STR_DBASE_HELPTEXT, STR_DBASE_HEADERTEXT, STR_DBASE_PATH_OR_FILE );
        return std::make_unique<OConnectionTabPageSetup>( pParent, "dbaccess/ui/dbwizconnectionpage.ui", "ConnectionPage", _rAttrSet, STR_DBASE_HELPTEXT, STR_DBASE_HEADERTEXT, STR_DBASE_PATH_OR_FILE );
    }

    VclPtr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateMSAccessTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet)
    std::unique_ptr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateMSAccessTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet)
    {
        return VclPtr<OConnectionTabPageSetup>::Create( pParent, "dbaccess/ui/dbwizconnectionpage.ui", "ConnectionPage", _rAttrSet, STR_MSACCESS_HELPTEXT, STR_MSACCESS_HEADERTEXT, STR_MSACCESS_MDB_FILE );
        return std::make_unique<OConnectionTabPageSetup>( pParent, "dbaccess/ui/dbwizconnectionpage.ui", "ConnectionPage", _rAttrSet, STR_MSACCESS_HELPTEXT, STR_MSACCESS_HEADERTEXT, STR_MSACCESS_MDB_FILE );
    }

    VclPtr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateADOTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet)
    std::unique_ptr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateADOTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet)
    {
        return VclPtr<OConnectionTabPageSetup>::Create( pParent, "dbaccess/ui/dbwizconnectionpage.ui", "ConnectionPage", _rAttrSet, STR_ADO_HELPTEXT, STR_ADO_HEADERTEXT, STR_COMMONURL );
        return std::make_unique<OConnectionTabPageSetup>( pParent, "dbaccess/ui/dbwizconnectionpage.ui", "ConnectionPage", _rAttrSet, STR_ADO_HELPTEXT, STR_ADO_HEADERTEXT, STR_COMMONURL );
    }

    VclPtr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateODBCTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet)
    std::unique_ptr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateODBCTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet)
    {
        return VclPtr<OConnectionTabPageSetup>::Create( pParent, "dbaccess/ui/dbwizconnectionpage.ui", "ConnectionPage", _rAttrSet, STR_ODBC_HELPTEXT, STR_ODBC_HEADERTEXT, STR_NAME_OF_ODBC_DATASOURCE );
        return std::make_unique<OConnectionTabPageSetup>( pParent, "dbaccess/ui/dbwizconnectionpage.ui", "ConnectionPage", _rAttrSet, STR_ODBC_HELPTEXT, STR_ODBC_HEADERTEXT, STR_NAME_OF_ODBC_DATASOURCE );
    }

    VclPtr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateUserDefinedTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet)
    std::unique_ptr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateUserDefinedTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet)
    {
        return VclPtr<OConnectionTabPageSetup>::Create(pParent, "dbaccess/ui/dbwizconnectionpage.ui", "ConnectionPage", _rAttrSet, nullptr, nullptr, STR_COMMONURL);
        return std::make_unique<OConnectionTabPageSetup>(pParent, "dbaccess/ui/dbwizconnectionpage.ui", "ConnectionPage", _rAttrSet, nullptr, nullptr, STR_COMMONURL);
    }

    OConnectionTabPageSetup::OConnectionTabPageSetup(TabPageParent pParent, const OUString& _rUIXMLDescription, const OString& _rId, const SfxItemSet& _rCoreAttrs, const char* pHelpTextResId, const char* pHeaderResId, const char* pUrlResId)
@@ -118,7 +118,6 @@ namespace dbaui

    OConnectionTabPageSetup::~OConnectionTabPageSetup()
    {
        disposeOnce();
    }

    void OConnectionTabPageSetup::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx
index 5ab2d47..b456f72 100644
--- a/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx
+++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx
@@ -36,8 +36,6 @@ namespace dbaui
    */
    class OConnectionTabPageSetup : public OConnectionHelper
    {
        friend class VclPtr<OConnectionTabPageSetup>;

        std::unique_ptr<weld::Label> m_xHelpText;
        std::unique_ptr<weld::Label> m_xHeaderText;

@@ -45,12 +43,14 @@ namespace dbaui
        DECL_LINK(OnEditModified, weld::Entry&, void);

    public:
        OConnectionTabPageSetup(TabPageParent pParent, const OUString& _rUIXMLDescription, const OString& _rId, const SfxItemSet& _rCoreAttrs, const char* pHelpTextResId, const char* pHeaderResId, const char* pUrlResId);
        virtual ~OConnectionTabPageSetup() override;
        static  VclPtr<OGenericAdministrationPage> CreateDbaseTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet);
        static  VclPtr<OGenericAdministrationPage> CreateMSAccessTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet);
        static  VclPtr<OGenericAdministrationPage> CreateADOTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet);
        static  VclPtr<OGenericAdministrationPage> CreateODBCTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet);
        static  VclPtr<OGenericAdministrationPage> CreateUserDefinedTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet);

        static std::unique_ptr<OGenericAdministrationPage> CreateDbaseTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet);
        static std::unique_ptr<OGenericAdministrationPage> CreateMSAccessTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet);
        static std::unique_ptr<OGenericAdministrationPage> CreateADOTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet);
        static std::unique_ptr<OGenericAdministrationPage> CreateODBCTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet);
        static std::unique_ptr<OGenericAdministrationPage> CreateUserDefinedTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet);

        virtual bool        FillItemSet (SfxItemSet* _rCoreAttrs) override;

@@ -58,9 +58,7 @@ namespace dbaui
        virtual bool        commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) override;

    protected:
        OConnectionTabPageSetup(TabPageParent pParent, const OUString& _rUIXMLDescription, const OString& _rId, const SfxItemSet& _rCoreAttrs, const char* pHelpTextResId, const char* pHeaderResId, const char* pUrlResId);
        virtual bool checkTestConnection() override;
            // nControlFlags is a combination of the CBTP_xxx-constants
    };


diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
index 5db44f6..b6a0bf5 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
@@ -60,9 +60,9 @@ namespace dbaui
{
using namespace ::com::sun::star;

    VclPtr<OGenericAdministrationPage> OTextConnectionPageSetup::CreateTextTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet)
    std::unique_ptr<OGenericAdministrationPage> OTextConnectionPageSetup::CreateTextTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet)
    {
        return VclPtr<OTextConnectionPageSetup>::Create(pParent, _rAttrSet);
        return std::make_unique<OTextConnectionPageSetup>(pParent, _rAttrSet);
    }

    // OTextConnectionPageSetup
@@ -75,15 +75,9 @@ using namespace ::com::sun::star;
        m_xTextConnectionHelper->SetClickHandler(LINK( this, OTextConnectionPageSetup, ImplGetExtensionHdl ) );
    }

    void OTextConnectionPageSetup::dispose()
    {
        m_xTextConnectionHelper.reset();
        OConnectionTabPageSetup::dispose();
    }

    OTextConnectionPageSetup::~OTextConnectionPageSetup()
    {
        disposeOnce();
        m_xTextConnectionHelper.reset();
    }

    IMPL_LINK_NOARG(OTextConnectionPageSetup, ImplGetExtensionHdl, OTextConnectionHelper*, void)
@@ -132,9 +126,9 @@ using namespace ::com::sun::star;
        return m_xTextConnectionHelper->prepareLeave();
    }

    VclPtr<OGenericAdministrationPage> OLDAPConnectionPageSetup::CreateLDAPTabPage( TabPageParent pParent, const SfxItemSet& _rAttrSet )
    std::unique_ptr<OGenericAdministrationPage> OLDAPConnectionPageSetup::CreateLDAPTabPage( TabPageParent pParent, const SfxItemSet& _rAttrSet )
    {
        return VclPtr<OLDAPConnectionPageSetup>::Create( pParent, _rAttrSet );
        return std::make_unique<OLDAPConnectionPageSetup>(pParent, _rAttrSet);
    }

    // OLDAPPageSetup
@@ -225,9 +219,9 @@ using namespace ::com::sun::star;
        OGenericAdministrationPage::callModifiedHdl();
    }

    VclPtr<OMySQLIntroPageSetup> OMySQLIntroPageSetup::CreateMySQLIntroTabPage(TabPageParent pParent, const SfxItemSet& rAttrSet)
    std::unique_ptr<OMySQLIntroPageSetup> OMySQLIntroPageSetup::CreateMySQLIntroTabPage(TabPageParent pParent, const SfxItemSet& rAttrSet)
    {
        return VclPtr<OMySQLIntroPageSetup>::Create(pParent, rAttrSet);
        return std::make_unique<OMySQLIntroPageSetup>(pParent, rAttrSet);
    }

    OMySQLIntroPageSetup::OMySQLIntroPageSetup(TabPageParent pParent, const SfxItemSet& _rCoreAttrs)
@@ -305,18 +299,12 @@ using namespace ::com::sun::star;

    MySQLNativeSetupPage::~MySQLNativeSetupPage()
    {
        disposeOnce();
        m_xMySQLSettings.reset();
    }

    void MySQLNativeSetupPage::dispose()
    std::unique_ptr<OGenericAdministrationPage> MySQLNativeSetupPage::Create(TabPageParent pParent, const SfxItemSet& rAttrSet)
    {
        m_xMySQLSettings.reset();
        OGenericAdministrationPage::dispose();
     }

    VclPtr<OGenericAdministrationPage> MySQLNativeSetupPage::Create(TabPageParent pParent, const SfxItemSet& rAttrSet)
    {
        return VclPtr<MySQLNativeSetupPage>::Create(pParent, rAttrSet);
        return std::make_unique<MySQLNativeSetupPage>(pParent, rAttrSet);
    }

    void MySQLNativeSetupPage::fillControls( std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList )
@@ -398,9 +386,9 @@ using namespace ::com::sun::star;
    {
    }

    VclPtr<OGenericAdministrationPage> OGeneralSpecialJDBCConnectionPageSetup::CreateMySQLJDBCTabPage( TabPageParent pParent, const SfxItemSet& _rAttrSet )
    std::unique_ptr<OGenericAdministrationPage> OGeneralSpecialJDBCConnectionPageSetup::CreateMySQLJDBCTabPage( TabPageParent pParent, const SfxItemSet& _rAttrSet )
    {
        return VclPtr<OGeneralSpecialJDBCConnectionPageSetup>::Create( pParent,
        return std::make_unique<OGeneralSpecialJDBCConnectionPageSetup>(pParent,
                                                         _rAttrSet,
                                                         DSID_MYSQL_PORTNUMBER ,
                                                         STR_MYSQL_DEFAULT,
@@ -409,9 +397,9 @@ using namespace ::com::sun::star;
                                                         STR_MYSQL_DRIVERCLASSTEXT);
    }

    VclPtr<OGenericAdministrationPage> OGeneralSpecialJDBCConnectionPageSetup::CreateOracleJDBCTabPage( TabPageParent pParent, const SfxItemSet& _rAttrSet )
    std::unique_ptr<OGenericAdministrationPage> OGeneralSpecialJDBCConnectionPageSetup::CreateOracleJDBCTabPage( TabPageParent pParent, const SfxItemSet& _rAttrSet )
    {
        return VclPtr<OGeneralSpecialJDBCConnectionPageSetup>::Create( pParent,
        return std::make_unique<OGeneralSpecialJDBCConnectionPageSetup>(pParent,
                                                          _rAttrSet,
                                                          DSID_ORACLE_PORTNUMBER,
                                                          STR_ORACLE_DEFAULT,
@@ -427,6 +415,7 @@ using namespace ::com::sun::star;
        _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::Entry>(m_xETHostname.get()));
        _rControlList.emplace_back(new OSaveValueWidgetWrapper<weld::SpinButton>(m_xNFPortNumber.get()));
    }

    void OGeneralSpecialJDBCConnectionPageSetup::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
    {
        _rControlList.emplace_back(new ODisableWidgetWrapper<weld::Label>(m_xFTHelpText.get()));
@@ -508,7 +497,7 @@ using namespace ::com::sun::star;
#endif
        const char *pMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
        const MessageType mt = bSuccess ? MessageType::Info : MessageType::Error;
        OSQLMessageBox aMsg(GetFrameWeld(), DBA_RES(pMessage), OUString(), MessBoxStyle::Ok | MessBoxStyle::DefaultOk, mt);
        OSQLMessageBox aMsg(GetDialogFrameWeld(), DBA_RES(pMessage), OUString(), MessBoxStyle::Ok | MessBoxStyle::DefaultOk, mt);
        aMsg.run();
    }

@@ -521,9 +510,9 @@ using namespace ::com::sun::star;
        OGenericAdministrationPage::callModifiedHdl();
    }

    VclPtr<OGenericAdministrationPage> OJDBCConnectionPageSetup::CreateJDBCTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet)
    std::unique_ptr<OGenericAdministrationPage> OJDBCConnectionPageSetup::CreateJDBCTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet)
    {
        return VclPtr<OJDBCConnectionPageSetup>::Create(pParent, _rAttrSet);
        return std::make_unique<OJDBCConnectionPageSetup>(pParent, _rAttrSet);
    }

    // OMySQLJDBCConnectionPageSetup
@@ -540,7 +529,6 @@ using namespace ::com::sun::star;

    OJDBCConnectionPageSetup::~OJDBCConnectionPageSetup()
    {
        disposeOnce();
    }

    void OJDBCConnectionPageSetup::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
@@ -621,7 +609,7 @@ using namespace ::com::sun::star;
#endif
        const char* pMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
        const MessageType mt = bSuccess ? MessageType::Info : MessageType::Error;
        OSQLMessageBox aMsg(GetFrameWeld(), DBA_RES(pMessage), OUString(), MessBoxStyle::Ok | MessBoxStyle::DefaultOk, mt);
        OSQLMessageBox aMsg(GetDialogFrameWeld(), DBA_RES(pMessage), OUString(), MessBoxStyle::Ok | MessBoxStyle::DefaultOk, mt);
        aMsg.run();
    }

@@ -634,9 +622,9 @@ using namespace ::com::sun::star;
        callModifiedHdl();
    }

    VclPtr<OGenericAdministrationPage> OSpreadSheetConnectionPageSetup::CreateDocumentOrSpreadSheetTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet)
    std::unique_ptr<OGenericAdministrationPage> OSpreadSheetConnectionPageSetup::CreateDocumentOrSpreadSheetTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet)
    {
        return VclPtr<OSpreadSheetConnectionPageSetup>::Create( pParent, _rAttrSet );
        return std::make_unique<OSpreadSheetConnectionPageSetup>(pParent, _rAttrSet);
    }

    OSpreadSheetConnectionPageSetup::OSpreadSheetConnectionPageSetup(TabPageParent pParent, const SfxItemSet& rCoreAttrs)
@@ -649,7 +637,6 @@ using namespace ::com::sun::star;

    OSpreadSheetConnectionPageSetup::~OSpreadSheetConnectionPageSetup()
    {
        disposeOnce();
    }

    void OSpreadSheetConnectionPageSetup::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& /*_rControlList*/)
@@ -670,9 +657,9 @@ using namespace ::com::sun::star;
        return bChangedSomething;
    }

    VclPtr<OGenericAdministrationPage> OAuthentificationPageSetup::CreateAuthentificationTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet)
    std::unique_ptr<OGenericAdministrationPage> OAuthentificationPageSetup::CreateAuthentificationTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet)
    {
        return VclPtr<OAuthentificationPageSetup>::Create( pParent, _rAttrSet);
        return std::make_unique<OAuthentificationPageSetup>(pParent, _rAttrSet);
    }

    OAuthentificationPageSetup::OAuthentificationPageSetup(TabPageParent pParent, const SfxItemSet& _rCoreAttrs)
@@ -733,9 +720,9 @@ using namespace ::com::sun::star;
        return bChangedSomething;
    }

    VclPtr<OGenericAdministrationPage> OFinalDBPageSetup::CreateFinalDBTabPageSetup(TabPageParent pParent, const SfxItemSet& _rAttrSet)
    std::unique_ptr<OGenericAdministrationPage> OFinalDBPageSetup::CreateFinalDBTabPageSetup(TabPageParent pParent, const SfxItemSet& _rAttrSet)
    {
        return VclPtr<OFinalDBPageSetup>::Create( pParent, _rAttrSet);
        return std::make_unique<OFinalDBPageSetup>(pParent, _rAttrSet);
    }

    OFinalDBPageSetup::OFinalDBPageSetup(TabPageParent pParent, const SfxItemSet& _rCoreAttrs)
diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx
index 4cee46b..23d2056 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx
@@ -40,7 +40,7 @@ namespace dbaui
    {
    public:
        virtual bool        FillItemSet ( SfxItemSet* _rCoreAttrs ) override;
        static VclPtr<OGenericAdministrationPage> CreateDocumentOrSpreadSheetTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet);
        static std::unique_ptr<OGenericAdministrationPage> CreateDocumentOrSpreadSheetTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet);
        OSpreadSheetConnectionPageSetup(TabPageParent pParent, const SfxItemSet& _rCoreAttrs);
        virtual ~OSpreadSheetConnectionPageSetup() override;

@@ -56,9 +56,8 @@ namespace dbaui
    {
    public:
        virtual bool        FillItemSet ( SfxItemSet* _rCoreAttrs ) override;
        static VclPtr<OGenericAdministrationPage> CreateTextTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet );
        static std::unique_ptr<OGenericAdministrationPage> CreateTextTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet );
        OTextConnectionPageSetup(TabPageParent pParent, const SfxItemSet& _rCoreAttrs);
        virtual void dispose() override;
        virtual ~OTextConnectionPageSetup() override;
    protected:
        virtual bool prepareLeave() override;
@@ -77,7 +76,7 @@ namespace dbaui
    {
    public:
        virtual bool        FillItemSet ( SfxItemSet* _rCoreAttrs ) override;
        static VclPtr<OGenericAdministrationPage> CreateLDAPTabPage( TabPageParent pParent, const SfxItemSet& _rAttrSet );
        static std::unique_ptr<OGenericAdministrationPage> CreateLDAPTabPage( TabPageParent pParent, const SfxItemSet& _rAttrSet );
        OLDAPConnectionPageSetup( TabPageParent pParent, const SfxItemSet& _rCoreAttrs );
        virtual ~OLDAPConnectionPageSetup() override;
        virtual void callModifiedHdl(weld::Widget* pControl = nullptr) override;
@@ -109,10 +108,9 @@ namespace dbaui

    public:
        MySQLNativeSetupPage(TabPageParent pParent, const SfxItemSet& rCoreAttrs);
        virtual void dispose() override;
        virtual ~MySQLNativeSetupPage() override;

        static VclPtr<OGenericAdministrationPage> Create(TabPageParent pParent, const SfxItemSet& rAttrSet);
        static std::unique_ptr<OGenericAdministrationPage> Create(TabPageParent pParent, const SfxItemSet& rAttrSet);

    protected:
        virtual void fillControls( std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList ) override;
@@ -136,8 +134,8 @@ namespace dbaui
                                        , const char* pHeaderTextResId
                                        , const char* pDriverClassId );
    virtual ~OGeneralSpecialJDBCConnectionPageSetup() override;
    static VclPtr<OGenericAdministrationPage> CreateMySQLJDBCTabPage( TabPageParent pParent, const SfxItemSet& _rAttrSet );
    static VclPtr<OGenericAdministrationPage> CreateOracleJDBCTabPage( TabPageParent pParent, const SfxItemSet& _rAttrSet );
    static std::unique_ptr<OGenericAdministrationPage> CreateMySQLJDBCTabPage( TabPageParent pParent, const SfxItemSet& _rAttrSet );
    static std::unique_ptr<OGenericAdministrationPage> CreateOracleJDBCTabPage( TabPageParent pParent, const SfxItemSet& _rAttrSet );

    private:
        virtual bool FillItemSet( SfxItemSet* _rCoreAttrs ) override;
@@ -172,7 +170,7 @@ namespace dbaui
    public:
        OJDBCConnectionPageSetup(TabPageParent pParent, const SfxItemSet& _rCoreAttrs);
        virtual ~OJDBCConnectionPageSetup() override;
        static VclPtr<OGenericAdministrationPage> CreateJDBCTabPage(TabPageParent pParent, const SfxItemSet& rAttrSet);
        static std::unique_ptr<OGenericAdministrationPage> CreateJDBCTabPage(TabPageParent pParent, const SfxItemSet& rAttrSet);

    private:
        virtual bool checkTestConnection() override;
@@ -203,7 +201,7 @@ namespace dbaui
        OMySQLIntroPageSetup(TabPageParent pParent, const SfxItemSet& rCoreAttrs);
        virtual ~OMySQLIntroPageSetup() override;

        static VclPtr<OMySQLIntroPageSetup> CreateMySQLIntroTabPage(TabPageParent pParent, const SfxItemSet& rAttrSet);
        static std::unique_ptr<OMySQLIntroPageSetup> CreateMySQLIntroTabPage(TabPageParent pParent, const SfxItemSet& rAttrSet);
        ConnectionType      getMySQLMode() const;
        void                SetClickHdl( const Link<OMySQLIntroPageSetup *, void>& rLink ) { maClickHdl = rLink; }

@@ -227,7 +225,7 @@ namespace dbaui
    {
    public:
        virtual bool        FillItemSet ( SfxItemSet* _rCoreAttrs ) override;
        static VclPtr<OGenericAdministrationPage> CreateAuthentificationTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet);
        static std::unique_ptr<OGenericAdministrationPage> CreateAuthentificationTabPage(TabPageParent pParent, const SfxItemSet& _rAttrSet);
        OAuthentificationPageSetup(TabPageParent pParent, const SfxItemSet& _rCoreAttrs);
        virtual ~OAuthentificationPageSetup() override;

@@ -248,7 +246,7 @@ namespace dbaui
    {
    public:
        virtual bool        FillItemSet ( SfxItemSet* _rCoreAttrs ) override;
        static VclPtr<OGenericAdministrationPage> CreateFinalDBTabPageSetup(TabPageParent pParent, const SfxItemSet& _rAttrSet);
        static std::unique_ptr<OGenericAdministrationPage> CreateFinalDBTabPageSetup(TabPageParent pParent, const SfxItemSet& _rAttrSet);

        OFinalDBPageSetup(TabPageParent pParent, const SfxItemSet& _rCoreAttrs);
        virtual ~OFinalDBPageSetup() override;
diff --git a/dbaccess/source/ui/dlg/DriverSettings.hxx b/dbaccess/source/ui/dlg/DriverSettings.hxx
index 4fa30d4..dc1482b 100644
--- a/dbaccess/source/ui/dlg/DriverSettings.hxx
+++ b/dbaccess/source/ui/dlg/DriverSettings.hxx
@@ -36,48 +36,48 @@ namespace dbaui

        /** Creates the detail page for ado
        */
        static  VclPtr<SfxTabPage> CreateDbase( TabPageParent _pParent, const SfxItemSet* _rAttrSet );
        static std::unique_ptr<SfxTabPage> CreateDbase( TabPageParent _pParent, const SfxItemSet* _rAttrSet );

        /** Creates the detail page for ado
        */
        static  VclPtr<SfxTabPage> CreateAdo( TabPageParent _pParent, const SfxItemSet* _rAttrSet );
        static std::unique_ptr<SfxTabPage> CreateAdo( TabPageParent _pParent, const SfxItemSet* _rAttrSet );

        /** Creates the detail page for ODBC
        */
        static  VclPtr<SfxTabPage> CreateODBC( TabPageParent _pParent, const SfxItemSet* _rAttrSet );
        static std::unique_ptr<SfxTabPage> CreateODBC( TabPageParent _pParent, const SfxItemSet* _rAttrSet );

        /** Creates the detail page for user
        */
        static  VclPtr<SfxTabPage> CreateUser( TabPageParent _pParent, const SfxItemSet* _rAttrSet );
        static std::unique_ptr<SfxTabPage> CreateUser( TabPageParent _pParent, const SfxItemSet* _rAttrSet );

        /** Creates the detail page for MySQLODBC
        */
        static  VclPtr<SfxTabPage> CreateMySQLODBC( TabPageParent _pParent, const SfxItemSet* _rAttrSet );
        static std::unique_ptr<SfxTabPage> CreateMySQLODBC( TabPageParent _pParent, const SfxItemSet* _rAttrSet );

        /** Creates the detail page for MySQLJDBC
        */
        static  VclPtr<SfxTabPage> CreateMySQLJDBC( TabPageParent _pParent, const SfxItemSet* _rAttrSet );
        static std::unique_ptr<SfxTabPage> CreateMySQLJDBC( TabPageParent _pParent, const SfxItemSet* _rAttrSet );

        /** Creates the detail page for MySQLNATIVE
        */
        static  VclPtr<SfxTabPage> CreateMySQLNATIVE( TabPageParent _pParent, const SfxItemSet* _rAttrSet );
        static std::unique_ptr<SfxTabPage> CreateMySQLNATIVE( TabPageParent _pParent, const SfxItemSet* _rAttrSet );

        /** Creates the detail page for Oracle JDBC
        */
        static VclPtr<SfxTabPage>  CreateOracleJDBC( TabPageParent pParent, const SfxItemSet* _rAttrSet );
        static std::unique_ptr<SfxTabPage> CreateOracleJDBC( TabPageParent pParent, const SfxItemSet* _rAttrSet );

        /** Creates the detail page for LDAP
        */
        static  VclPtr<SfxTabPage> CreateLDAP( TabPageParent _pParent, const SfxItemSet* _rAttrSet );
        static std::unique_ptr<SfxTabPage> CreateLDAP( TabPageParent _pParent, const SfxItemSet* _rAttrSet );

        /// Creates the detail page for Text
        static  VclPtr<SfxTabPage> CreateText( TabPageParent _pParent, const SfxItemSet* _rAttrSet );
        static std::unique_ptr<SfxTabPage> CreateText( TabPageParent _pParent, const SfxItemSet* _rAttrSet );

        /// creates the GeneratedValues page
        static  VclPtr<SfxTabPage> CreateGeneratedValuesPage( TabPageParent _pParent, const SfxItemSet* _rAttrSet );
        static std::unique_ptr<SfxTabPage> CreateGeneratedValuesPage( TabPageParent _pParent, const SfxItemSet* _rAttrSet );

        /// creates the "Special Settings" page of the "Advanced Settings" dialog
        static  VclPtr<SfxTabPage> CreateSpecialSettingsPage( TabPageParent _pParent, const SfxItemSet* _rAttrSet );
        static std::unique_ptr<SfxTabPage> CreateSpecialSettingsPage( TabPageParent _pParent, const SfxItemSet* _rAttrSet );
    };
}

diff --git a/dbaccess/source/ui/dlg/TablesSingleDlg.cxx b/dbaccess/source/ui/dlg/TablesSingleDlg.cxx
index c6fcbc7..ab8a20f 100644
--- a/dbaccess/source/ui/dlg/TablesSingleDlg.cxx
+++ b/dbaccess/source/ui/dlg/TablesSingleDlg.cxx
@@ -49,9 +49,9 @@ OTableSubscriptionDialog::OTableSubscriptionDialog(weld::Window* pParent
    SetInputSet(m_pOutSet.get());

    TabPageParent pPageParent(get_content_area(), this);
    auto pTabPage = VclPtrInstance<OTableSubscriptionPage>(pPageParent, *m_pOutSet, this);
    pTabPage->SetServiceFactory(_rxORB);
    SetTabPage(pTabPage);
    auto xTabPage = std::make_unique<OTableSubscriptionPage>(pPageParent, *m_pOutSet, this);
    xTabPage->SetServiceFactory(_rxORB);
    SetTabPage(std::move(xTabPage));
}

OTableSubscriptionDialog::~OTableSubscriptionDialog()
diff --git a/dbaccess/source/ui/dlg/UserAdmin.cxx b/dbaccess/source/ui/dlg/UserAdmin.cxx
index b0f31d0..4d65851 100644
--- a/dbaccess/source/ui/dlg/UserAdmin.cxx
+++ b/dbaccess/source/ui/dlg/UserAdmin.cxx
@@ -128,16 +128,10 @@ OUserAdmin::OUserAdmin(TabPageParent pParent,const SfxItemSet& _rAttrSet)

OUserAdmin::~OUserAdmin()
{
    disposeOnce();
}

void OUserAdmin::dispose()
{
    m_xConnection = nullptr;
    m_xTableCtrl.disposeAndClear();
    m_xTableCtrlParent->dispose();
    m_xTableCtrlParent.clear();
    OGenericAdministrationPage::dispose();
}

void OUserAdmin::FillUserNames()
@@ -186,9 +180,9 @@ void OUserAdmin::FillUserNames()
    m_xTableCtrl->Enable(m_xUsers.is());
}

VclPtr<SfxTabPage> OUserAdmin::Create( TabPageParent pParent, const SfxItemSet* _rAttrSet )
std::unique_ptr<SfxTabPage> OUserAdmin::Create( TabPageParent pParent, const SfxItemSet* _rAttrSet )
{
    return VclPtr<OUserAdmin>::Create( pParent, *_rAttrSet );
    return std::make_unique<OUserAdmin>( pParent, *_rAttrSet );
}

IMPL_LINK(OUserAdmin, UserHdl, weld::Button&, rButton, void)
@@ -312,7 +306,7 @@ void OUserAdmin::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
    }
    catch(const SQLException& e)
    {
        ::dbtools::showError(::dbtools::SQLExceptionInfo(e), VCLUnoHelper::GetInterface(this), m_xORB);
        ::dbtools::showError(::dbtools::SQLExceptionInfo(e), GetDialogController()->getDialog()->GetXWindow(), m_xORB);
    }

    OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue);
diff --git a/dbaccess/source/ui/dlg/UserAdmin.hxx b/dbaccess/source/ui/dlg/UserAdmin.hxx
index bfcf77e..50561a9 100644
--- a/dbaccess/source/ui/dlg/UserAdmin.hxx
+++ b/dbaccess/source/ui/dlg/UserAdmin.hxx
@@ -37,7 +37,6 @@ namespace dbaui

class OUserAdmin final : public OGenericAdministrationPage
{
    friend class VclPtr<OUserAdmin>;
    std::unique_ptr<weld::ComboBox> m_xUSER;
    std::unique_ptr<weld::Button> m_xNEWUSER;
    std::unique_ptr<weld::Button> m_xCHANGEPWD;
@@ -58,12 +57,11 @@ class OUserAdmin final : public OGenericAdministrationPage

    void        FillUserNames();

    OUserAdmin(TabPageParent pParent, const SfxItemSet& _rCoreAttrs);
public:
    static  VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* _rAttrSet);

    OUserAdmin(TabPageParent pParent, const SfxItemSet& _rCoreAttrs);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet);
    virtual ~OUserAdmin() override;
    virtual void dispose() override;

    OUString GetUser() const;

    // subclasses must override this, but it isn't pure virtual
diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx
index 1133a09..6678824 100644
--- a/dbaccess/source/ui/dlg/adminpages.cxx
+++ b/dbaccess/source/ui/dlg/adminpages.cxx
@@ -62,8 +62,8 @@ namespace dbaui
    {
        SetExchangeSupport();

        Size aSize(LogicToPixel(::Size(WIZARD_PAGE_X, WIZARD_PAGE_Y), MapMode(MapUnit::MapAppFont)));
        m_xContainer->set_size_request(aSize.Width(), aSize.Height());
        m_xContainer->set_size_request(m_xContainer->get_approximate_digit_width() * WIZARD_PAGE_X,
                                       m_xContainer->get_text_height() * WIZARD_PAGE_Y);
    }

    DeactivateRC OGenericAdministrationPage::DeactivatePage(SfxItemSet* _pSet)
@@ -82,13 +82,15 @@ namespace dbaui
    {
        implInitControls(*_rCoreAttrs, false);
    }
    void OGenericAdministrationPage::ActivatePage()

    void OGenericAdministrationPage::Activate()
    {
        TabPage::ActivatePage();
        BuilderPage::Activate();
        OSL_ENSURE(m_pItemSetHelper,"NO ItemSetHelper set!");
        if ( m_pItemSetHelper )
            ActivatePage(*m_pItemSetHelper->getOutputSet());
    }

    void OGenericAdministrationPage::ActivatePage(const SfxItemSet& _rSet)
    {
        implInitControls(_rSet, true);
@@ -132,7 +134,7 @@ namespace dbaui
            // show an error message
            OUString sError(DBA_RES(STR_COULD_NOT_LOAD_ODBC_LIB));
            sError = sError.replaceFirst("#lib#", aEnumeration.getLibraryName());
            std::unique_ptr<weld::MessageDialog> xDialog(Application::CreateMessageDialog(GetFrameWeld(),
            std::unique_ptr<weld::MessageDialog> xDialog(Application::CreateMessageDialog(GetDialogFrameWeld(),
                                                         VclMessageType::Warning, VclButtonsType::Ok,
                                                         sError));
            xDialog->run();
@@ -142,7 +144,7 @@ namespace dbaui
        {
            aEnumeration.getDatasourceNames(aOdbcDatasources);
            // execute the select dialog
            ODatasourceSelectDialog aSelector(GetFrameWeld(), aOdbcDatasources);
            ODatasourceSelectDialog aSelector(GetDialogFrameWeld(), aOdbcDatasources);
            if (!_sCurr.isEmpty())
                aSelector.Select(_sCurr);
            if (RET_OK == aSelector.run())
@@ -270,7 +272,7 @@ namespace dbaui
                    eImage = MessageType::Error;
                    aMessage = DBA_RES(STR_CONNECTION_NO_SUCCESS);
                }
                OSQLMessageBox aMsg(GetFrameWeld(), sTitle, aMessage, MessBoxStyle::Ok, eImage);
                OSQLMessageBox aMsg(GetDialogFrameWeld(), sTitle, aMessage, MessBoxStyle::Ok, eImage);
                aMsg.run();
            }
            if ( !bSuccess )
diff --git a/dbaccess/source/ui/dlg/adminpages.hxx b/dbaccess/source/ui/dlg/adminpages.hxx
index 7266901..bc473b6 100644
--- a/dbaccess/source/ui/dlg/adminpages.hxx
+++ b/dbaccess/source/ui/dlg/adminpages.hxx
@@ -149,14 +149,13 @@ namespace dbaui
    protected:
        /// default implementation: call FillItemSet, call prepareLeave,
        virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override;
        using SfxTabPage::DeactivatePage;
        /// default implementation: call implInitControls with the given item set and _bSaveValue = sal_False
        virtual void Reset(const SfxItemSet* _rCoreAttrs) override;
        /// default implementation: call implInitControls with the given item set and _bSaveValue = sal_True
        virtual void ActivatePage(const SfxItemSet& _rSet) override;

        // TabPage overridables
        virtual void    ActivatePage() override;
        // BuilderPage overridables
        virtual void    Activate() override;

    protected:
        virtual void callModifiedHdl(weld::Widget* /*pControl*/ = nullptr) { m_aModifiedHandler.Call(this); }
diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx
index ccbc88c..02661a2 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.cxx
+++ b/dbaccess/source/ui/dlg/advancedsettings.cxx
@@ -151,7 +151,6 @@ namespace dbaui

    SpecialSettingsPage::~SpecialSettingsPage()
    {
        disposeOnce();
    }

    void SpecialSettingsPage::fillWindows( std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList )
@@ -307,7 +306,6 @@ namespace dbaui

    GeneratedValuesPage::~GeneratedValuesPage()
    {
        disposeOnce();
    }

    void GeneratedValuesPage::fillWindows( std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList )
diff --git a/dbaccess/source/ui/dlg/advancedsettings.hxx b/dbaccess/source/ui/dlg/advancedsettings.hxx
index 2c63146..002c5cd 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.hxx
+++ b/dbaccess/source/ui/dlg/advancedsettings.hxx
@@ -73,10 +73,9 @@ namespace dbaui
        virtual bool        FillItemSet ( SfxItemSet* _rCoreAttrs ) override;

        SpecialSettingsPage(TabPageParent pParent, const SfxItemSet& _rCoreAttrs, const DataSourceMetaData& _rDSMeta);

    private:
        virtual ~SpecialSettingsPage() override;

    private:
        // OGenericAdministrationPage overridables
        virtual void implInitControls (const SfxItemSet& _rSet, bool _bSaveValue ) override;

@@ -103,12 +102,11 @@ namespace dbaui
        virtual bool        FillItemSet (SfxItemSet* _rCoreAttrs) override;

        GeneratedValuesPage(TabPageParent pParent, const SfxItemSet& _rCoreAttrs);
        virtual ~GeneratedValuesPage() override;

    private:
        DECL_LINK(OnAutoToggleHdl, weld::ToggleButton&, void);

        // nControlFlags is a combination of the CBTP_xxx-constants
        virtual ~GeneratedValuesPage() override;

        // subclasses must override this, but it isn't pure virtual
        virtual void        implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;

diff --git a/dbaccess/source/ui/dlg/dbwiz.cxx b/dbaccess/source/ui/dlg/dbwiz.cxx
index af03675..76e933a 100644
--- a/dbaccess/source/ui/dlg/dbwiz.cxx
+++ b/dbaccess/source/ui/dlg/dbwiz.cxx
@@ -219,10 +219,10 @@ void ODbTypeWizDialog::clearPassword()
    m_pImpl->clearPassword();
}

VclPtr<TabPage> ODbTypeWizDialog::createPage(WizardState _nState)
std::unique_ptr<BuilderPage> ODbTypeWizDialog::createPage(WizardState _nState)
{
    const char* pStringId = STR_PAGETITLE_ADVANCED;
    VclPtr<TabPage> pPage;
    std::unique_ptr<BuilderPage> xPage;

    OString sIdent(OString::number(_nState));
    weld::Container* pPageContainer = m_xAssistant->append_page(sIdent);
@@ -233,46 +233,46 @@ VclPtr<TabPage> ODbTypeWizDialog::createPage(WizardState _nState)
    {
        case START_PAGE: // start state
        {
            pPage = VclPtr<OGeneralPageDialog>::Create(aParent, *m_pOutSet);
            OGeneralPage* pGeneralPage = static_cast< OGeneralPage* >( pPage.get() );
            xPage = std::make_unique<OGeneralPageDialog>(aParent, *m_pOutSet);
            OGeneralPage* pGeneralPage = static_cast<OGeneralPage*>(xPage.get());
            pGeneralPage->SetTypeSelectHandler( LINK( this, ODbTypeWizDialog, OnTypeSelected));
            pStringId = STR_PAGETITLE_GENERAL;
        }
        break;
        case CONNECTION_PAGE:
            pPage = OConnectionTabPage::Create(aParent, m_pOutSet.get());
            xPage = OConnectionTabPage::Create(aParent, m_pOutSet.get());
            pStringId = STR_PAGETITLE_CONNECTION;
            break;

        case ADDITIONAL_PAGE_DBASE:
            pPage = ODriversSettings::CreateDbase(aParent, m_pOutSet.get());
            xPage = ODriversSettings::CreateDbase(aParent, m_pOutSet.get());
            break;
        case ADDITIONAL_PAGE_FLAT:
            pPage = ODriversSettings::CreateText(aParent, m_pOutSet.get());
            xPage = ODriversSettings::CreateText(aParent, m_pOutSet.get());
            break;
        case ADDITIONAL_PAGE_LDAP:
            pPage = ODriversSettings::CreateLDAP(aParent, m_pOutSet.get());
            xPage = ODriversSettings::CreateLDAP(aParent, m_pOutSet.get());
            break;
        case ADDITIONAL_PAGE_MYSQL_JDBC:
            pPage = ODriversSettings::CreateMySQLJDBC(aParent, m_pOutSet.get());
            xPage = ODriversSettings::CreateMySQLJDBC(aParent, m_pOutSet.get());
            break;
        case ADDITIONAL_PAGE_MYSQL_NATIVE:
            pPage = ODriversSettings::CreateMySQLNATIVE(aParent, m_pOutSet.get());
            xPage = ODriversSettings::CreateMySQLNATIVE(aParent, m_pOutSet.get());
            break;
        case ADDITIONAL_PAGE_MYSQL_ODBC:
            pPage = ODriversSettings::CreateMySQLODBC(aParent, m_pOutSet.get());
            xPage = ODriversSettings::CreateMySQLODBC(aParent, m_pOutSet.get());
            break;
        case ADDITIONAL_PAGE_ORACLE_JDBC:
            pPage = ODriversSettings::CreateOracleJDBC(aParent, m_pOutSet.get());
            xPage = ODriversSettings::CreateOracleJDBC(aParent, m_pOutSet.get());
            break;
        case ADDITIONAL_PAGE_ADO:
            pPage = ODriversSettings::CreateAdo(aParent, m_pOutSet.get());
            xPage = ODriversSettings::CreateAdo(aParent, m_pOutSet.get());
            break;
        case ADDITIONAL_PAGE_ODBC:
            pPage = ODriversSettings::CreateODBC(aParent, m_pOutSet.get());
            xPage = ODriversSettings::CreateODBC(aParent, m_pOutSet.get());
            break;
        case ADDITIONAL_USERDEFINED:
            pPage = ODriversSettings::CreateUser(aParent, m_pOutSet.get());
            xPage = ODriversSettings::CreateUser(aParent, m_pOutSet.get());
            break;
        default:
            OSL_FAIL("Wrong state!");
@@ -280,17 +280,15 @@ VclPtr<TabPage> ODbTypeWizDialog::createPage(WizardState _nState)
    }

    // register ourself as modified listener
    if ( pPage )
    if ( xPage )
    {
        static_cast<OGenericAdministrationPage*>(pPage.get())->SetServiceFactory( m_pImpl->getORB() );
        static_cast<OGenericAdministrationPage*>(pPage.get())->SetAdminDialog(this,this);
        static_cast<OGenericAdministrationPage*>(xPage.get())->SetServiceFactory( m_pImpl->getORB() );
        static_cast<OGenericAdministrationPage*>(xPage.get())->SetAdminDialog(this,this);
        m_xAssistant->set_page_title(sIdent, DBA_RES(pStringId));
        defaultButton( _nState == START_PAGE ? WizardButtonFlags::NEXT : WizardButtonFlags::FINISH );
        enableButtons( WizardButtonFlags::FINISH, _nState != START_PAGE);

        pPage->Show();
    }
    return pPage;
    return xPage;
}

bool ODbTypeWizDialog::leaveState(WizardState _nState)
@@ -329,9 +327,9 @@ void ODbTypeWizDialog::saveDatasource()
    DataSourceInfoConverter::convert( getORB(), m_pCollection,sOldURL,m_eType,m_pImpl->getCurrentDataSource());
}

vcl::IWizardPageController* ODbTypeWizDialog::getPageController( TabPage* _pCurrentPage ) const
vcl::IWizardPageController* ODbTypeWizDialog::getPageController(BuilderPage* pCurrentPage) const
{
    OGenericAdministrationPage* pPage = static_cast<OGenericAdministrationPage*>(_pCurrentPage);
    OGenericAdministrationPage* pPage = static_cast<OGenericAdministrationPage*>(pCurrentPage);
    return pPage;
}

diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx
index e37edfa..6431801 100644
--- a/dbaccess/source/ui/dlg/dbwizsetup.cxx
+++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx
@@ -423,7 +423,7 @@ Reference< XDriver > ODbTypeWizDialogSetup::getDriver()
OUString ODbTypeWizDialogSetup::getDatasourceType(const SfxItemSet& _rSet) const
{
    OUString sRet = dbaui::ODbDataSourceAdministrationHelper::getDatasourceType(_rSet);
    if (m_pMySQLIntroPage != nullptr && m_pMySQLIntroPage->IsVisible() )
    if (m_pMySQLIntroPage && m_pMySQLIntroPage->IsVisible())
    {
        switch( m_pMySQLIntroPage->getMySQLMode() )
        {
@@ -446,10 +446,9 @@ void ODbTypeWizDialogSetup::clearPassword()
    m_pImpl->clearPassword();
}

VclPtr<TabPage> ODbTypeWizDialogSetup::createPage(WizardState _nState)
std::unique_ptr<BuilderPage> ODbTypeWizDialogSetup::createPage(WizardState _nState)
{
    VclPtr<SfxTabPage> pFirstPage;
    VclPtr<OGenericAdministrationPage> pPage;
    std::unique_ptr<OGenericAdministrationPage> xPage;

    OString sIdent(OString::number(_nState));
    weld::Container* pPageContainer = m_xAssistant->append_page(sIdent);
@@ -459,9 +458,8 @@ VclPtr<TabPage> ODbTypeWizDialogSetup::createPage(WizardState _nState)
    switch(_nState)
    {
        case PAGE_DBSETUPWIZARD_INTRO:
            pFirstPage = VclPtr<OGeneralPageWizard>::Create(aParent,*m_pOutSet);
            pPage = static_cast<OGenericAdministrationPage*> (pFirstPage.get());
            m_pGeneralPage = static_cast<OGeneralPageWizard*>(pFirstPage.get());
            xPage = std::make_unique<OGeneralPageWizard>(aParent,*m_pOutSet);
            m_pGeneralPage = static_cast<OGeneralPageWizard*>(xPage.get());
            m_pGeneralPage->SetTypeSelectHandler(LINK(this, ODbTypeWizDialogSetup, OnTypeSelected));
            m_pGeneralPage->SetCreationModeHandler(LINK( this, ODbTypeWizDialogSetup, OnChangeCreationMode ) );
            m_pGeneralPage->SetDocumentSelectionHandler(LINK( this, ODbTypeWizDialogSetup, OnRecentDocumentSelected ) );
@@ -469,83 +467,83 @@ VclPtr<TabPage> ODbTypeWizDialogSetup::createPage(WizardState _nState)
            break;

        case PAGE_DBSETUPWIZARD_DBASE:
            pPage = OConnectionTabPageSetup::CreateDbaseTabPage(aParent, *m_pOutSet);
            xPage = OConnectionTabPageSetup::CreateDbaseTabPage(aParent, *m_pOutSet);
            break;

        case PAGE_DBSETUPWIZARD_ADO:
            pPage = OConnectionTabPageSetup::CreateADOTabPage(aParent, *m_pOutSet);
            xPage = OConnectionTabPageSetup::CreateADOTabPage(aParent, *m_pOutSet);
            break;

        case PAGE_DBSETUPWIZARD_TEXT:
            pPage = OTextConnectionPageSetup::CreateTextTabPage(aParent, *m_pOutSet);
            xPage = OTextConnectionPageSetup::CreateTextTabPage(aParent, *m_pOutSet);
            break;

        case PAGE_DBSETUPWIZARD_ODBC:
            pPage = OConnectionTabPageSetup::CreateODBCTabPage(aParent, *m_pOutSet);
            xPage = OConnectionTabPageSetup::CreateODBCTabPage(aParent, *m_pOutSet);
            break;

        case PAGE_DBSETUPWIZARD_JDBC:
            pPage = OJDBCConnectionPageSetup::CreateJDBCTabPage(aParent, *m_pOutSet);
            xPage = OJDBCConnectionPageSetup::CreateJDBCTabPage(aParent, *m_pOutSet);
            break;

        case PAGE_DBSETUPWIZARD_MYSQL_ODBC:
            m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getPrefix("sdbc:mysql:odbc:")));
            pPage = OConnectionTabPageSetup::CreateODBCTabPage(aParent, *m_pOutSet);
            xPage = OConnectionTabPageSetup::CreateODBCTabPage(aParent, *m_pOutSet);
            break;

        case PAGE_DBSETUPWIZARD_MYSQL_JDBC:
            m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getPrefix("sdbc:mysql:jdbc:")));
            pPage = OGeneralSpecialJDBCConnectionPageSetup::CreateMySQLJDBCTabPage(aParent, *m_pOutSet);
            xPage = OGeneralSpecialJDBCConnectionPageSetup::CreateMySQLJDBCTabPage(aParent, *m_pOutSet);
            break;
        case PAGE_DBSETUPWIZARD_MYSQL_NATIVE:
            m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, m_pCollection->getPrefix("sdbc:mysql:mysqlc:")));
            pPage = MySQLNativeSetupPage::Create(aParent, *m_pOutSet);
            xPage = MySQLNativeSetupPage::Create(aParent, *m_pOutSet);
            break;

        case PAGE_DBSETUPWIZARD_ORACLE:
            pPage = OGeneralSpecialJDBCConnectionPageSetup::CreateOracleJDBCTabPage(aParent, *m_pOutSet);
            xPage = OGeneralSpecialJDBCConnectionPageSetup::CreateOracleJDBCTabPage(aParent, *m_pOutSet);
            break;

        case PAGE_DBSETUPWIZARD_LDAP:
            pPage = OLDAPConnectionPageSetup::CreateLDAPTabPage(aParent, *m_pOutSet);
            xPage = OLDAPConnectionPageSetup::CreateLDAPTabPage(aParent, *m_pOutSet);
            break;

        case PAGE_DBSETUPWIZARD_DOCUMENT_OR_SPREADSHEET:
            pPage = OSpreadSheetConnectionPageSetup::CreateDocumentOrSpreadSheetTabPage(aParent, *m_pOutSet);
            xPage = OSpreadSheetConnectionPageSetup::CreateDocumentOrSpreadSheetTabPage(aParent, *m_pOutSet);
            break;

        case PAGE_DBSETUPWIZARD_MSACCESS:
            pPage  = OConnectionTabPageSetup::CreateMSAccessTabPage(aParent, *m_pOutSet);
            xPage  = OConnectionTabPageSetup::CreateMSAccessTabPage(aParent, *m_pOutSet);
            break;
        case PAGE_DBSETUPWIZARD_MYSQL_INTRO:
            m_pMySQLIntroPage = OMySQLIntroPageSetup::CreateMySQLIntroTabPage(aParent, *m_pOutSet);
            xPage = OMySQLIntroPageSetup::CreateMySQLIntroTabPage(aParent, *m_pOutSet);
            m_pMySQLIntroPage = static_cast<OMySQLIntroPageSetup*>(xPage.get());
            m_pMySQLIntroPage->SetClickHdl(LINK( this, ODbTypeWizDialogSetup, ImplClickHdl ) );
            pPage = m_pMySQLIntroPage;
            break;

        case PAGE_DBSETUPWIZARD_AUTHENTIFICATION:
            pPage = OAuthentificationPageSetup::CreateAuthentificationTabPage(aParent, *m_pOutSet);
            xPage = OAuthentificationPageSetup::CreateAuthentificationTabPage(aParent, *m_pOutSet);
            break;

        case PAGE_DBSETUPWIZARD_USERDEFINED:
            pPage = OConnectionTabPageSetup::CreateUserDefinedTabPage(aParent, *m_pOutSet);
            xPage = OConnectionTabPageSetup::CreateUserDefinedTabPage(aParent, *m_pOutSet);
            break;

        case PAGE_DBSETUPWIZARD_FINAL:
            pPage = OFinalDBPageSetup::CreateFinalDBTabPageSetup(aParent, *m_pOutSet);
            m_pFinalPage = static_cast<OFinalDBPageSetup*> (pPage.get());
            xPage = OFinalDBPageSetup::CreateFinalDBTabPageSetup(aParent, *m_pOutSet);
            m_pFinalPage = static_cast<OFinalDBPageSetup*>(xPage.get());
            break;
    }

    if ( pPage )
    if ( xPage )
    {
        if ((_nState != PAGE_DBSETUPWIZARD_INTRO) && (_nState != PAGE_DBSETUPWIZARD_AUTHENTIFICATION))
        {
            pPage->SetModifiedHandler(LINK( this, ODbTypeWizDialogSetup, ImplModifiedHdl ) );
            xPage->SetModifiedHandler(LINK( this, ODbTypeWizDialogSetup, ImplModifiedHdl ) );
        }

        pPage->SetServiceFactory( m_pImpl->getORB() );
        pPage->SetAdminDialog(this, this);
        xPage->SetServiceFactory( m_pImpl->getORB() );
        xPage->SetAdminDialog(this, this);

        defaultButton( _nState == PAGE_DBSETUPWIZARD_FINAL ? WizardButtonFlags::FINISH : WizardButtonFlags::NEXT );
        enableButtons( WizardButtonFlags::FINISH, _nState == PAGE_DBSETUPWIZARD_FINAL );
@@ -553,7 +551,7 @@ VclPtr<TabPage> ODbTypeWizDialogSetup::createPage(WizardState _nState)

        m_xAssistant->set_page_title(sIdent, getStateDisplayName(_nState));
    }
    return pPage;
    return xPage;
}

IMPL_LINK(ODbTypeWizDialogSetup, ImplModifiedHdl, OGenericAdministrationPage const *, _pConnectionPageSetup, void)
@@ -847,9 +845,9 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
        return aExistenceCheck.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset );
    }

    vcl::IWizardPageController* ODbTypeWizDialogSetup::getPageController( TabPage* _pCurrentPage ) const
    vcl::IWizardPageController* ODbTypeWizDialogSetup::getPageController(BuilderPage* pCurrentPage) const
    {
        OGenericAdministrationPage* pPage = static_cast<OGenericAdministrationPage*>(_pCurrentPage);
        OGenericAdministrationPage* pPage = static_cast<OGenericAdministrationPage*>(pCurrentPage);
        return pPage;
    }

diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx
index 4f23ef87..21ad0a6 100644
--- a/dbaccess/source/ui/dlg/detailpages.cxx
+++ b/dbaccess/source/ui/dlg/detailpages.cxx
@@ -88,13 +88,7 @@ namespace dbaui

    OCommonBehaviourTabPage::~OCommonBehaviourTabPage()
    {
        disposeOnce();
    }

    void OCommonBehaviourTabPage::dispose()
    {
        m_xCharset.reset();
        OGenericAdministrationPage::dispose();
    }

    void OCommonBehaviourTabPage::fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
@@ -178,12 +172,11 @@ namespace dbaui

    ODbaseDetailsPage::~ODbaseDetailsPage()
    {
        disposeOnce();
    }

    VclPtr<SfxTabPage> ODriversSettings::CreateDbase(TabPageParent pParent, const SfxItemSet* _rAttrSet)
    std::unique_ptr<SfxTabPage> ODriversSettings::CreateDbase(TabPageParent pParent, const SfxItemSet* _rAttrSet)
    {
        return VclPtr<ODbaseDetailsPage>::Create(pParent, *_rAttrSet);
        return std::make_unique<ODbaseDetailsPage>(pParent, *_rAttrSet);
    }

    void ODbaseDetailsPage::implInitControls(const SfxItemSet& _rSet, bool _bSaveValue)
@@ -242,9 +235,9 @@ namespace dbaui

    }

    VclPtr<SfxTabPage> ODriversSettings::CreateAdo(TabPageParent pParent, const SfxItemSet* rAttrSet)
    std::unique_ptr<SfxTabPage> ODriversSettings::CreateAdo(TabPageParent pParent, const SfxItemSet* rAttrSet)
    {
        return VclPtr<OAdoDetailsPage>::Create(pParent, *rAttrSet);
        return std::make_unique<OAdoDetailsPage>(pParent, *rAttrSet);
    }

    // OOdbcDetailsPage
@@ -258,12 +251,11 @@ namespace dbaui

    OOdbcDetailsPage::~OOdbcDetailsPage()
    {
        disposeOnce();
    }

    VclPtr<SfxTabPage> ODriversSettings::CreateODBC(TabPageParent pParent, const SfxItemSet* pAttrSet)
    std::unique_ptr<SfxTabPage> ODriversSettings::CreateODBC(TabPageParent pParent, const SfxItemSet* pAttrSet)
    {
        return VclPtr<OOdbcDetailsPage>::Create(pParent, *pAttrSet);
        return std::make_unique<OOdbcDetailsPage>(pParent, *pAttrSet);
    }

    bool OOdbcDetailsPage::FillItemSet( SfxItemSet* _rSet )
@@ -300,12 +292,11 @@ namespace dbaui

    OUserDriverDetailsPage::~OUserDriverDetailsPage()
    {
        disposeOnce();
    }

    VclPtr<SfxTabPage> ODriversSettings::CreateUser(TabPageParent pParent, const SfxItemSet* pAttrSet)
    std::unique_ptr<SfxTabPage> ODriversSettings::CreateUser(TabPageParent pParent, const SfxItemSet* pAttrSet)
    {
        return VclPtr<OUserDriverDetailsPage>::Create(pParent, *pAttrSet);
        return std::make_unique<OUserDriverDetailsPage>(pParent, *pAttrSet);
    }

    bool OUserDriverDetailsPage::FillItemSet( SfxItemSet* _rSet )
@@ -361,9 +352,9 @@ namespace dbaui
    {
    }

    VclPtr<SfxTabPage> ODriversSettings::CreateMySQLODBC(TabPageParent pParent, const SfxItemSet* pAttrSet)
    std::unique_ptr<SfxTabPage> ODriversSettings::CreateMySQLODBC(TabPageParent pParent, const SfxItemSet* pAttrSet)
    {
        return VclPtr<OMySQLODBCDetailsPage>::Create(pParent, *pAttrSet);
        return std::make_unique<OMySQLODBCDetailsPage>(pParent, *pAttrSet);
    }

    // OMySQLJDBCDetailsPage
@@ -410,7 +401,6 @@ namespace dbaui

    OGeneralSpecialJDBCDetailsPage::~OGeneralSpecialJDBCDetailsPage()
    {
        disposeOnce();
    }

    bool OGeneralSpecialJDBCDetailsPage::FillItemSet( SfxItemSet* _rSet )
@@ -485,7 +475,7 @@ namespace dbaui
#endif
        const char* pMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
        const MessageType mt = bSuccess ? MessageType::Info : MessageType::Error;
        OSQLMessageBox aMsg(GetFrameWeld(), DBA_RES(pMessage), OUString(), MessBoxStyle::Ok | MessBoxStyle::DefaultOk, mt);
        OSQLMessageBox aMsg(GetDialogFrameWeld(), DBA_RES(pMessage), OUString(), MessBoxStyle::Ok | MessBoxStyle::DefaultOk, mt);
        aMsg.run();
    }

@@ -512,15 +502,9 @@ namespace dbaui
        m_xUserName->connect_changed(LINK(this,OGenericAdministrationPage,OnControlEntryModifyHdl));
    }

    void MySQLNativePage::dispose()
    {
        m_xMySQLSettings.reset();
        OCommonBehaviourTabPage::dispose();
    }

    MySQLNativePage::~MySQLNativePage()
    {
        disposeOnce();
        m_xMySQLSettings.reset();
    }

    void MySQLNativePage::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
@@ -579,19 +563,19 @@ namespace dbaui
        OCommonBehaviourTabPage::implInitControls(_rSet, _bSaveValue);
    }

    VclPtr<SfxTabPage> ODriversSettings::CreateMySQLJDBC( TabPageParent pParent, const SfxItemSet* _rAttrSet )
    std::unique_ptr<SfxTabPage> ODriversSettings::CreateMySQLJDBC( TabPageParent pParent, const SfxItemSet* _rAttrSet )
    {
        return VclPtr<OGeneralSpecialJDBCDetailsPage>::Create(pParent, *_rAttrSet,DSID_MYSQL_PORTNUMBER);
        return std::make_unique<OGeneralSpecialJDBCDetailsPage>(pParent, *_rAttrSet,DSID_MYSQL_PORTNUMBER);
    }

    VclPtr<SfxTabPage> ODriversSettings::CreateMySQLNATIVE(TabPageParent pParent, const SfxItemSet* pAttrSet)
    std::unique_ptr<SfxTabPage> ODriversSettings::CreateMySQLNATIVE(TabPageParent pParent, const SfxItemSet* pAttrSet)
    {
        return VclPtr<MySQLNativePage>::Create(pParent, *pAttrSet);
        return std::make_unique<MySQLNativePage>(pParent, *pAttrSet);
    }

    VclPtr<SfxTabPage> ODriversSettings::CreateOracleJDBC(TabPageParent pParent, const SfxItemSet* _rAttrSet)
    std::unique_ptr<SfxTabPage> ODriversSettings::CreateOracleJDBC(TabPageParent pParent, const SfxItemSet* _rAttrSet)
    {
        return VclPtr<OGeneralSpecialJDBCDetailsPage>::Create(pParent, *_rAttrSet,DSID_ORACLE_PORTNUMBER, false);
        return std::make_unique<OGeneralSpecialJDBCDetailsPage>(pParent, *_rAttrSet,DSID_ORACLE_PORTNUMBER, false);
    }

    // OLDAPDetailsPage
@@ -614,12 +598,11 @@ namespace dbaui

    OLDAPDetailsPage::~OLDAPDetailsPage()
    {
        disposeOnce();
    }

    VclPtr<SfxTabPage> ODriversSettings::CreateLDAP(TabPageParent pParent, const SfxItemSet* _rAttrSet)
    std::unique_ptr<SfxTabPage> ODriversSettings::CreateLDAP(TabPageParent pParent, const SfxItemSet* _rAttrSet)
    {
        return VclPtr<OLDAPDetailsPage>::Create(pParent, *_rAttrSet);
        return std::make_unique<OLDAPDetailsPage>(pParent, *_rAttrSet);
    }

    bool OLDAPDetailsPage::FillItemSet( SfxItemSet* _rSet )
@@ -680,18 +663,12 @@ namespace dbaui

    OTextDetailsPage::~OTextDetailsPage()
    {
        disposeOnce();
    }

    void OTextDetailsPage::dispose()
    {
        m_xTextConnectionHelper.reset();
        OCommonBehaviourTabPage::dispose();
    }

    VclPtr<SfxTabPage> ODriversSettings::CreateText(TabPageParent pParent,  const SfxItemSet* pAttrSet)
    std::unique_ptr<SfxTabPage> ODriversSettings::CreateText(TabPageParent pParent,  const SfxItemSet* pAttrSet)
    {
        return VclPtr<OTextDetailsPage>::Create(pParent, *pAttrSet);
        return std::make_unique<OTextDetailsPage>(pParent, *pAttrSet);
    }

    void OTextDetailsPage::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList)
@@ -728,16 +705,16 @@ namespace dbaui
        return m_xTextConnectionHelper->prepareLeave();
    }

    VclPtr<SfxTabPage> ODriversSettings::CreateGeneratedValuesPage(TabPageParent pParent, const SfxItemSet* _rAttrSet)
    std::unique_ptr<SfxTabPage> ODriversSettings::CreateGeneratedValuesPage(TabPageParent pParent, const SfxItemSet* _rAttrSet)
    {
        return VclPtr<GeneratedValuesPage>::Create(pParent, *_rAttrSet);
        return std::make_unique<GeneratedValuesPage>(pParent, *_rAttrSet);
    }

    VclPtr<SfxTabPage> ODriversSettings::CreateSpecialSettingsPage(TabPageParent pParent, const SfxItemSet* _rAttrSet)
    std::unique_ptr<SfxTabPage> ODriversSettings::CreateSpecialSettingsPage(TabPageParent pParent, const SfxItemSet* _rAttrSet)
    {
        OUString eType = ODbDataSourceAdministrationHelper::getDatasourceType( *_rAttrSet );
        DataSourceMetaData aMetaData( eType );
        return VclPtr<SpecialSettingsPage>::Create(pParent, *_rAttrSet, aMetaData);
        return std::make_unique<SpecialSettingsPage>(pParent, *_rAttrSet, aMetaData);
    }
}   // namespace dbaui

diff --git a/dbaccess/source/ui/dlg/detailpages.hxx b/dbaccess/source/ui/dlg/detailpages.hxx
index da0f28f..bc0086d 100644
--- a/dbaccess/source/ui/dlg/detailpages.hxx
+++ b/dbaccess/source/ui/dlg/detailpages.hxx
@@ -69,7 +69,6 @@ namespace dbaui
    protected:

        virtual ~OCommonBehaviourTabPage() override;
        virtual void dispose() override;

        // subclasses must override this, but it isn't pure virtual
        virtual void        implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
@@ -190,7 +189,6 @@ namespace dbaui
    {
    public:
        MySQLNativePage(TabPageParent pParent, const SfxItemSet& rCoreAttrs);
        virtual void dispose() override;
        virtual ~MySQLNativePage() override;

    private:
@@ -238,10 +236,9 @@ namespace dbaui
        virtual bool        FillItemSet ( SfxItemSet* _rCoreAttrs ) override;

        OTextDetailsPage(TabPageParent pParent, const SfxItemSet& rCoreAttrs);
        virtual ~OTextDetailsPage() override;

    protected:
        virtual ~OTextDetailsPage() override;
        virtual void dispose() override;
        virtual bool prepareLeave() override;

        virtual void implInitControls(const SfxItemSet& _rSet, bool _bSaveValue) override;
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx
index c703a2f..8c65d97 100644
--- a/dbaccess/source/ui/dlg/generalpage.cxx
+++ b/dbaccess/source/ui/dlg/generalpage.cxx
@@ -515,7 +515,7 @@ namespace dbaui
        bool bValid, bReadonly;
        getFlags( _rSet, bValid, bReadonly );

        SetText( OUString() );
        SetPageTitle(OUString());

        if ( !bValid || bReadonly )
        {
diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx
index 339eb91..ec1d912 100644
--- a/dbaccess/source/ui/dlg/tablespage.cxx
+++ b/dbaccess/source/ui/dlg/tablespage.cxx
@@ -88,18 +88,12 @@ namespace dbaui

    OTableSubscriptionPage::~OTableSubscriptionPage()
    {
        disposeOnce();
    }

    void OTableSubscriptionPage::dispose()
    {
        // just to make sure that our connection will be removed
        try
        {
            ::comphelper::disposeComponent(m_xCurrentConnection);
        }
        catch (RuntimeException&) { }
        OGenericAdministrationPage::dispose();
    }

    void OTableSubscriptionPage::implCheckTables(const Sequence< OUString >& _rTables)
diff --git a/dbaccess/source/ui/dlg/tablespage.hxx b/dbaccess/source/ui/dlg/tablespage.hxx
index 6103e49..24ef1c0 100644
--- a/dbaccess/source/ui/dlg/tablespage.hxx
+++ b/dbaccess/source/ui/dlg/tablespage.hxx
@@ -48,11 +48,9 @@ namespace dbaui
    public:
        virtual bool            FillItemSet(SfxItemSet* _rCoreAttrs) override;
        virtual DeactivateRC    DeactivatePage(SfxItemSet* _pSet) override;
        using OGenericAdministrationPage::DeactivatePage;

        OTableSubscriptionPage(TabPageParent pParent, const SfxItemSet& _rCoreAttrs ,OTableSubscriptionDialog* _pTablesDlg);
        virtual ~OTableSubscriptionPage() override;
        virtual void dispose() override;

    private:
        virtual void fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
diff --git a/dbaccess/source/ui/inc/WCPage.hxx b/dbaccess/source/ui/inc/WCPage.hxx
index 61b1f78..4bfeb59 100644
--- a/dbaccess/source/ui/inc/WCPage.hxx
+++ b/dbaccess/source/ui/inc/WCPage.hxx
@@ -55,7 +55,7 @@ namespace dbaui

    public:
        virtual void            Reset() override;
        virtual void            ActivatePage() override;
        virtual void            Activate() override;
        virtual bool            LeavePage() override;
        virtual OUString        GetTitle() const override ;

diff --git a/dbaccess/source/ui/inc/WColumnSelect.hxx b/dbaccess/source/ui/inc/WColumnSelect.hxx
index 816b13b..23024c4 100644
--- a/dbaccess/source/ui/inc/WColumnSelect.hxx
+++ b/dbaccess/source/ui/inc/WColumnSelect.hxx
@@ -74,13 +74,12 @@ namespace dbaui

    public:
        virtual void            Reset ( ) override;
        virtual void            ActivatePage() override;
        virtual void            Activate() override;
        virtual bool            LeavePage() override;
        virtual OUString        GetTitle() const override ;

        OWizColumnSelect(OCopyTableWizard* pWizard, TabPageParent pParent);
        virtual ~OWizColumnSelect() override;
        virtual void dispose() override;
    };
}
#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_WCOLUMNSELECT_HXX
diff --git a/dbaccess/source/ui/inc/WCopyTable.hxx b/dbaccess/source/ui/inc/WCopyTable.hxx
index 53fb201..e12c00b 100644
--- a/dbaccess/source/ui/inc/WCopyTable.hxx
+++ b/dbaccess/source/ui/inc/WCopyTable.hxx
@@ -286,7 +286,7 @@ namespace dbaui
        // checks if the type is supported in the destination database
        bool supportsType(sal_Int32 _nDataType,sal_Int32& _rNewDataType);

        virtual VclPtr<TabPage> createPage(vcl::WizardTypes::WizardState /*nState*/) override
        virtual std::unique_ptr<BuilderPage> createPage(vcl::WizardTypes::WizardState /*nState*/) override
        {
            assert(false);
            return nullptr;
@@ -331,7 +331,7 @@ namespace dbaui
        weld::Button&       GetOKButton() { return *m_xFinish; }
        Wizard_Button_Style GetPressedButton() const { return m_ePressed; }
        void                EnableNextButton(bool bEnable);
        void                AddWizardPage(OWizardPage* pPage); // delete page from OCopyTableWizard
        void                AddWizardPage(std::unique_ptr<OWizardPage> xPage); // delete page from OCopyTableWizard
        void                CheckButtons(); // checks which button can be disabled, enabled

        // returns a vector where the position of a column and if the column is in the selection
diff --git a/dbaccess/source/ui/inc/WExtendPages.hxx b/dbaccess/source/ui/inc/WExtendPages.hxx
index 90ba9ed..b9cc15b 100644
--- a/dbaccess/source/ui/inc/WExtendPages.hxx
+++ b/dbaccess/source/ui/inc/WExtendPages.hxx
@@ -37,7 +37,7 @@ namespace dbaui
        {
        }

        static VclPtr<OWizTypeSelect> Create(OCopyTableWizard* pWizard, TabPageParent pParent, SvStream& rInput ) { return VclPtr<OWizHTMLExtend>::Create(pWizard, pParent, rInput); }
        static std::unique_ptr<OWizTypeSelect> Create(OCopyTableWizard* pWizard, TabPageParent pParent, SvStream& rInput ) { return std::make_unique<OWizHTMLExtend>(pWizard, pParent, rInput); }
    };
    // Wizard Page: OWizRTFExtend
    class OWizRTFExtend : public OWizTypeSelect
@@ -50,7 +50,7 @@ namespace dbaui
        {
        }

        static VclPtr<OWizTypeSelect> Create(OCopyTableWizard* pWizard, TabPageParent pParent, SvStream& rInput) { return VclPtr<OWizRTFExtend>::Create(pWizard, pParent, rInput); }
        static std::unique_ptr<OWizTypeSelect> Create(OCopyTableWizard* pWizard, TabPageParent pParent, SvStream& rInput) { return std::make_unique<OWizRTFExtend>(pWizard, pParent, rInput); }
    };

    // Wizard Page: OWizNormalExtend
diff --git a/dbaccess/source/ui/inc/WNameMatch.hxx b/dbaccess/source/ui/inc/WNameMatch.hxx
index 05cc948..5bf0df8 100644
--- a/dbaccess/source/ui/inc/WNameMatch.hxx
+++ b/dbaccess/source/ui/inc/WNameMatch.hxx
@@ -55,7 +55,7 @@ namespace dbaui

    public:
        virtual void            Reset ( ) override;
        virtual void            ActivatePage() override;
        virtual void            Activate() override;
        virtual bool            LeavePage() override;
        virtual OUString        GetTitle() const override ;

diff --git a/dbaccess/source/ui/inc/WTabPage.hxx b/dbaccess/source/ui/inc/WTabPage.hxx
index fe2df1d..9f8abfa 100644
--- a/dbaccess/source/ui/inc/WTabPage.hxx
+++ b/dbaccess/source/ui/inc/WTabPage.hxx
@@ -20,18 +20,15 @@
#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_WTABPAGE_HXX
#define INCLUDED_DBACCESS_SOURCE_UI_INC_WTABPAGE_HXX

#include <vcl/tabpage.hxx>
#include <vcl/wizardmachine.hxx>

namespace dbaui
{
    // Wizard Page
    class OCopyTableWizard;
    class OWizardPage       : public TabPage
    class OWizardPage : public ::vcl::OWizardPage
    {
    protected:
        std::unique_ptr<weld::Builder> m_xBuilder;
        std::unique_ptr<weld::Container> m_xContainer;

        OCopyTableWizard*       m_pParent;
        bool                    m_bFirstTime;   // Page is called the first time; should be set in the reset method

diff --git a/dbaccess/source/ui/inc/WTypeSelect.hxx b/dbaccess/source/ui/inc/WTypeSelect.hxx
index e0cfabb..aafdd9e 100644
--- a/dbaccess/source/ui/inc/WTypeSelect.hxx
+++ b/dbaccess/source/ui/inc/WTypeSelect.hxx
@@ -37,7 +37,7 @@ namespace dbaui
    // OWizTypeSelectControl
    class OWizTypeSelectControl final : public OFieldDescControl
    {
        VclPtr<OWizTypeSelect> m_xParentTabPage;
        OWizTypeSelect* m_pParentTabPage;
        virtual void        ActivateAggregate( EControlType eType ) override;
        virtual void        DeactivateAggregate( EControlType eType ) override;

@@ -52,7 +52,6 @@ namespace dbaui

    public:
        OWizTypeSelectControl(TabPageParent pParent, OWizTypeSelect* pParentTabPage);
        virtual void dispose() override;
        virtual ~OWizTypeSelectControl() override;

        virtual css::uno::Reference< css::sdbc::XDatabaseMetaData> getMetaData() override;
@@ -72,14 +71,14 @@ namespace dbaui

        DECL_LINK(CommandHdl, const CommandEvent&, bool);

        VclPtr<OWizTypeSelect> m_xParentTabPage;
        OWizTypeSelect* m_pParentTabPage;

        Link<weld::TreeView&, void> m_aChangeHdl;

    public:
        OWizTypeSelectList(std::unique_ptr<weld::TreeView> xControl);
        void SetPKey(bool bPKey) { m_bPKey = bPKey; }
        void SetParentTabPage(OWizTypeSelect* pParentTabPage) { m_xParentTabPage = pParentTabPage; }
        void SetParentTabPage(OWizTypeSelect* pParentTabPage) { m_pParentTabPage = pParentTabPage; }
        weld::TreeView* GetWidget() { return m_xControl.get(); }
        OUString get_selected_id() const { return m_xControl->get_selected_id(); }
        void show() { m_xControl->show(); }
@@ -133,19 +132,18 @@ namespace dbaui
        void                    EnableAuto(bool bEnable);
    public:
        virtual void            Reset ( ) override;
        virtual void            ActivatePage( ) override;
        virtual void            Activate( ) override;
        virtual bool            LeavePage() override;
        virtual OUString        GetTitle() const override;

        OWizTypeSelect(OCopyTableWizard* pWizard, TabPageParent pParent, SvStream* pStream = nullptr);
        virtual void dispose() override;
        virtual ~OWizTypeSelect() override;

        void setDisplayRow(sal_Int32 _nRow) { m_nDisplayRow = _nRow - 1; }
        void setDuplicateName(bool _bDuplicateName) { m_bDuplicateName = _bDuplicateName; }
    };

    typedef VclPtr<OWizTypeSelect> (*TypeSelectionPageFactory)(OCopyTableWizard*, TabPageParent, SvStream&);
    typedef std::unique_ptr<OWizTypeSelect> (*TypeSelectionPageFactory)(OCopyTableWizard*, TabPageParent, SvStream&);
}
#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_WTYPESELECT_HXX

diff --git a/dbaccess/source/ui/inc/dbu_dlg.hxx b/dbaccess/source/ui/inc/dbu_dlg.hxx
index f6d3687..02e7034 100644
--- a/dbaccess/source/ui/inc/dbu_dlg.hxx
+++ b/dbaccess/source/ui/inc/dbu_dlg.hxx
@@ -19,13 +19,8 @@
#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_DBU_DLG_HRC
#define INCLUDED_DBACCESS_SOURCE_UI_INC_DBU_DLG_HRC

#define PAGE_X              281
#define PAGE_Y              215
#define WIZARD_PAGE_X       225
#define WIZARD_PAGE_Y       240

//constants for the wizards
#define INDENT_BELOW_RADIO   10
#define WIZARD_PAGE_X       56
#define WIZARD_PAGE_Y       30

#endif

diff --git a/dbaccess/source/ui/inc/dbwiz.hxx b/dbaccess/source/ui/inc/dbwiz.hxx
index 8773477..6c17e33 100644
--- a/dbaccess/source/ui/inc/dbwiz.hxx
+++ b/dbaccess/source/ui/inc/dbwiz.hxx
@@ -88,11 +88,10 @@ public:

protected:
    /// to override to create new pages
    virtual VclPtr<TabPage> createPage(WizardState _nState) override;
    virtual std::unique_ptr<BuilderPage> createPage(WizardState _nState) override;
    virtual WizardState determineNextState(WizardState _nCurrentState) const override;
    virtual bool        leaveState(WizardState _nState) override;
    virtual ::vcl::IWizardPageController*
                        getPageController( TabPage* _pCurrentPage ) const override;
    virtual ::vcl::IWizardPageController* getPageController(BuilderPage* pCurrentPage) const override;
    virtual bool        onFinish() override;

private:
diff --git a/dbaccess/source/ui/inc/dbwizsetup.hxx b/dbaccess/source/ui/inc/dbwizsetup.hxx
index 4747397..ce23ef6 100644
--- a/dbaccess/source/ui/inc/dbwizsetup.hxx
+++ b/dbaccess/source/ui/inc/dbwizsetup.hxx
@@ -82,9 +82,9 @@ private:
    OUString                m_sRM_FinalText;
    INetURLObject           m_aDocURL;
    OUString                m_sWorkPath;
    VclPtr<OGeneralPageWizard>     m_pGeneralPage;
    VclPtr<OMySQLIntroPageSetup>   m_pMySQLIntroPage;
    VclPtr<OFinalDBPageSetup>      m_pFinalPage;
    OGeneralPageWizard*     m_pGeneralPage;
    OMySQLIntroPageSetup*   m_pMySQLIntroPage;
    OFinalDBPageSetup*      m_pFinalPage;

    ::dbaccess::ODsnTypeCollection*
                            m_pCollection;  /// the DSN type collection instance
@@ -124,10 +124,10 @@ public:

private:
    /// to override to create new pages
    virtual VclPtr<TabPage> createPage(WizardState _nState) override;
    virtual std::unique_ptr<BuilderPage> createPage(WizardState _nState) override;
    virtual bool        leaveState(WizardState _nState) override;
    virtual void        enterState(WizardState _nState) override;
    virtual ::vcl::IWizardPageController* getPageController( TabPage* _pCurrentPage ) const override;
    virtual ::vcl::IWizardPageController* getPageController(BuilderPage* pCurrentPage) const override;
    virtual bool        onFinish() override;

    void resetPages(const css::uno::Reference< css::beans::XPropertySet >& _rxDatasource);
diff --git a/dbaccess/source/ui/misc/WCPage.cxx b/dbaccess/source/ui/misc/WCPage.cxx
index ae07cb9..fe3b15b 100644
--- a/dbaccess/source/ui/misc/WCPage.cxx
+++ b/dbaccess/source/ui/misc/WCPage.cxx
@@ -91,7 +91,7 @@ OCopyTable::OCopyTable(OCopyTableWizard* pWizard, TabPageParent pParent)
        m_xEdKeyName->set_max_length(nMaxLen ? nMaxLen : EDIT_NOLIMIT);
    }

    SetText(DBA_RES(STR_COPYTABLE_TITLE_COPY));
    SetPageTitle(DBA_RES(STR_COPYTABLE_TITLE_COPY));
}

OCopyTable::~OCopyTable()
@@ -216,7 +216,7 @@ bool OCopyTable::LeavePage()
    return true;
}

void OCopyTable::ActivatePage()
void OCopyTable::Activate()
{
    m_pParent->GetOKButton().set_sensitive(true);
    m_nOldOperation = m_pParent->getOperation();
diff --git a/dbaccess/source/ui/misc/WColumnSelect.cxx b/dbaccess/source/ui/misc/WColumnSelect.cxx
index 89fd3a8..5939eda 100644
--- a/dbaccess/source/ui/misc/WColumnSelect.cxx
+++ b/dbaccess/source/ui/misc/WColumnSelect.cxx
@@ -44,10 +44,7 @@ namespace CopyTableOperation = ::com::sun::star::sdb::application::CopyTableOper
OUString OWizColumnSelect::GetTitle() const { return DBA_RES(STR_WIZ_COLUMN_SELECT_TITEL); }

OWizardPage::OWizardPage(OCopyTableWizard* pWizard, TabPageParent pParent, const OUString& rUIXMLDescription, const OString& rID)
    : TabPage(pParent.pPage ? Application::GetDefDialogParent() : pParent.pParent.get()) //just drag this along hidden in this scenario
    , m_xBuilder(pParent.pPage ? Application::CreateBuilder(pParent.pPage, rUIXMLDescription)
                               : Application::CreateInterimBuilder(this, rUIXMLDescription))
    , m_xContainer(m_xBuilder->weld_container(rID))
    : ::vcl::OWizardPage(pParent, rUIXMLDescription, rID)
    , m_pParent(pWizard)
    , m_bFirstTime(true)
{
@@ -81,17 +78,11 @@ OWizColumnSelect::OWizColumnSelect(OCopyTableWizard* pWizard, TabPageParent pPar

OWizColumnSelect::~OWizColumnSelect()
{
    disposeOnce();
}

void OWizColumnSelect::dispose()
{
    while (m_xNewColumnNames->n_children())
    {
        delete reinterpret_cast<OFieldDescription*>(m_xNewColumnNames->get_id(0).toInt64());
        m_xNewColumnNames->remove(0);
    }
    OWizardPage::dispose();
}

void OWizColumnSelect::Reset()
@@ -116,7 +107,7 @@ void OWizColumnSelect::Reset()
    m_bFirstTime = false;
}

void OWizColumnSelect::ActivatePage( )
void OWizColumnSelect::Activate( )
{
    // if there are no dest columns reset the left side with the original columns
    if(m_pParent->getDestColumns().empty())
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx
index fe217d3..e4c26e7 100644
--- a/dbaccess/source/ui/misc/WCopyTable.cxx
+++ b/dbaccess/source/ui/misc/WCopyTable.cxx
@@ -566,16 +566,16 @@ OCopyTableWizard::OCopyTableWizard(weld::Window* pParent, const OUString& _rDefa
        m_sName = ::dbtools::composeTableName(m_xDestConnection->getMetaData(),sCatalog,sSchema,sTable,false,::dbtools::EComposeRule::InTableDefinitions);
    }

    VclPtrInstance<OCopyTable> pPage1(this, CreatePageContainer());
    pPage1->disallowUseHeaderLine();
    std::unique_ptr<OCopyTable> xPage1(new OCopyTable(this, CreatePageContainer()));
    xPage1->disallowUseHeaderLine();
    if ( !bAllowViews )
        pPage1->disallowViews();
    pPage1->setCreateStyleAction();
    AddWizardPage(pPage1);
        xPage1->disallowViews();
    xPage1->setCreateStyleAction();
    AddWizardPage(std::move(xPage1));

    AddWizardPage( VclPtr<OWizNameMatching>::Create(this, CreatePageContainer() ) );
    AddWizardPage( VclPtr<OWizColumnSelect>::Create(this, CreatePageContainer() ) );
    AddWizardPage( VclPtr<OWizNormalExtend>::Create(this, CreatePageContainer() ) );
    AddWizardPage( std::make_unique<OWizNameMatching>(this, CreatePageContainer() ) );
    AddWizardPage( std::make_unique<OWizColumnSelect>(this, CreatePageContainer() ) );
    AddWizardPage( std::make_unique<OWizNormalExtend>(this, CreatePageContainer() ) );
    ActivatePage();

    m_xAssistant->set_current_page(0);
@@ -620,13 +620,13 @@ OCopyTableWizard::OCopyTableWizard( weld::Window* pParent, const OUString& _rDef

    m_xInteractionHandler = InteractionHandler::createWithParent(m_xContext, nullptr);

    VclPtrInstance<OCopyTable> pPage1( this, CreatePageContainer() );
    pPage1->disallowViews();
    pPage1->setCreateStyleAction();
    AddWizardPage( pPage1 );
    std::unique_ptr<OCopyTable> xPage1(new OCopyTable(this, CreatePageContainer()));
    xPage1->disallowViews();
    xPage1->setCreateStyleAction();
    AddWizardPage(std::move(xPage1));

    AddWizardPage( VclPtr<OWizNameMatching>::Create( this, CreatePageContainer() ) );
    AddWizardPage( VclPtr<OWizColumnSelect>::Create( this, CreatePageContainer() ) );
    AddWizardPage( std::make_unique<OWizNameMatching>( this, CreatePageContainer() ) );
    AddWizardPage( std::make_unique<OWizColumnSelect>( this, CreatePageContainer() ) );
    AddWizardPage( (*_pTypeSelectionPageFactory)( this, CreatePageContainer(), _rTypeSelectionPageArg ) );

    ActivatePage();
@@ -951,9 +951,9 @@ bool OCopyTableWizard::DeactivatePage()
    return pPage && pPage->LeavePage();
}

void OCopyTableWizard::AddWizardPage(OWizardPage* pPage)
void OCopyTableWizard::AddWizardPage(std::unique_ptr<OWizardPage> xPage)
{
    AddPage(pPage);
    AddPage(std::move(xPage));
    ++m_nPageCount;
}

diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx
index 258394b..47539c2 100644
--- a/dbaccess/source/ui/misc/WNameMatch.cxx
+++ b/dbaccess/source/ui/misc/WNameMatch.cxx
@@ -78,7 +78,7 @@ void OWizNameMatching::Reset()
    m_bFirstTime = false;
}

void OWizNameMatching::ActivatePage( )
void OWizNameMatching::Activate( )
{
    // set source table name
    OUString aName = m_sSourceText + m_pParent->m_sSourceName;
diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx
index 06fcf50..a9bf1af 100644
--- a/dbaccess/source/ui/misc/WTypeSelect.cxx
+++ b/dbaccess/source/ui/misc/WTypeSelect.cxx
@@ -46,19 +46,12 @@ using namespace ::com::sun::star::sdbc;
// OWizTypeSelectControl
OWizTypeSelectControl::OWizTypeSelectControl(TabPageParent pParent, OWizTypeSelect* pParentTabPage)
    : OFieldDescControl(pParent, nullptr)
    , m_xParentTabPage(pParentTabPage)
    , m_pParentTabPage(pParentTabPage)
{
}

OWizTypeSelectControl::~OWizTypeSelectControl()
{
    disposeOnce();
}

void OWizTypeSelectControl::dispose()
{
    m_xParentTabPage.clear();
    OFieldDescControl::dispose();
}

void OWizTypeSelectControl::ActivateAggregate( EControlType eType )
@@ -93,7 +86,7 @@ void OWizTypeSelectControl::CellModified(long nRow, sal_uInt16 nColId )
{
    OSL_ENSURE(nRow == -1,"nRow must be -1!");

    weld::TreeView* pListBox = m_xParentTabPage->m_xColumnNames->GetWidget();
    weld::TreeView* pListBox = m_pParentTabPage->m_xColumnNames->GetWidget();

    OFieldDescription* pCurFieldDescr = getCurrentFieldDescData();

@@ -114,7 +107,7 @@ void OWizTypeSelectControl::CellModified(long nRow, sal_uInt16 nColId )
    {
        case FIELD_PROPERTY_COLUMNNAME:
            {
                OCopyTableWizard* pWiz = m_xParentTabPage->m_pParent;
                OCopyTableWizard* pWiz = m_pParentTabPage->m_pParent;
                // first we have to check if this name already exists
                bool bDoubleName = false;
                bool bCase = true;
@@ -143,13 +136,13 @@ void OWizTypeSelectControl::CellModified(long nRow, sal_uInt16 nColId )
                    pWiz->showError(strMessage);
                    pCurFieldDescr->SetName(sName);
                    DisplayData(pCurFieldDescr);
                    m_xParentTabPage->setDuplicateName(true);
                    m_pParentTabPage->setDuplicateName(true);
                    return;
                }

                OUString sOldName = pCurFieldDescr->GetName();
                pCurFieldDescr->SetName(sNewName);
                m_xParentTabPage->setDuplicateName(false);
                m_pParentTabPage->setDuplicateName(false);

                // now we change the name

@@ -176,42 +169,42 @@ void OWizTypeSelectControl::CellModified(long nRow, sal_uInt16 nColId )

css::lang::Locale  OWizTypeSelectControl::GetLocale() const
{
    return m_xParentTabPage->m_pParent->GetLocale();
    return m_pParentTabPage->m_pParent->GetLocale();
}

Reference< XNumberFormatter > OWizTypeSelectControl::GetFormatter() const
{
    return m_xParentTabPage->m_pParent->GetFormatter();
    return m_pParentTabPage->m_pParent->GetFormatter();
}

TOTypeInfoSP    OWizTypeSelectControl::getTypeInfo(sal_Int32 _nPos)
{
    return m_xParentTabPage->m_pParent->getDestTypeInfo(_nPos);
    return m_pParentTabPage->m_pParent->getDestTypeInfo(_nPos);
}

const OTypeInfoMap* OWizTypeSelectControl::getTypeInfo() const
{
    return &m_xParentTabPage->m_pParent->getDestTypeInfo();
    return &m_pParentTabPage->m_pParent->getDestTypeInfo();
}

css::uno::Reference< css::sdbc::XDatabaseMetaData> OWizTypeSelectControl::getMetaData()
{
    return m_xParentTabPage->m_pParent->m_xDestConnection->getMetaData();
    return m_pParentTabPage->m_pParent->m_xDestConnection->getMetaData();
}

css::uno::Reference< css::sdbc::XConnection> OWizTypeSelectControl::getConnection()
{
    return m_xParentTabPage->m_pParent->m_xDestConnection;
    return m_pParentTabPage->m_pParent->m_xDestConnection;
}

bool OWizTypeSelectControl::isAutoIncrementValueEnabled() const
{
    return m_xParentTabPage->m_bAutoIncrementEnabled;
    return m_pParentTabPage->m_bAutoIncrementEnabled;
}

OUString OWizTypeSelectControl::getAutoIncrementValue() const
{
    return m_xParentTabPage->m_sAutoIncrementValue;
    return m_pParentTabPage->m_sAutoIncrementValue;
}

OWizTypeSelect::OWizTypeSelect(OCopyTableWizard* pWizard, TabPageParent pParent, SvStream* pStream)
@@ -254,13 +247,7 @@ OWizTypeSelect::OWizTypeSelect(OCopyTableWizard* pWizard, TabPageParent pParent,

OWizTypeSelect::~OWizTypeSelect()
{
    disposeOnce();
}

void OWizTypeSelect::dispose()
{
    m_xTypeControl.disposeAndClear();
    OWizardPage::dispose();
}

OUString OWizTypeSelect::GetTitle() const
@@ -296,7 +283,7 @@ void OWizTypeSelect::Reset()
    m_bFirstTime = false;
}

void OWizTypeSelect::ActivatePage( )
void OWizTypeSelect::Activate( )
{
    bool bOldFirstTime = m_bFirstTime;
    Reset();
@@ -342,13 +329,13 @@ IMPL_LINK_NOARG(OWizTypeSelect, ButtonClickHdl, weld::Button&, void)
        m_pParserStream->Seek(nTell);
    }

    ActivatePage();
    Activate();
}

OWizTypeSelectList::OWizTypeSelectList(std::unique_ptr<weld::TreeView> xControl)
    : m_xControl(std::move(xControl))
    , m_bPKey(false)
    , m_xParentTabPage(nullptr)
    , m_pParentTabPage(nullptr)
{
    m_xControl->connect_popup_menu(LINK(this, OWizTypeSelectList, CommandHdl));
}
diff --git a/extensions/source/abpilot/abpfinalpage.cxx b/extensions/source/abpilot/abpfinalpage.cxx
index b94331e..952c4a1 100644
--- a/extensions/source/abpilot/abpfinalpage.cxx
+++ b/extensions/source/abpilot/abpfinalpage.cxx
@@ -70,13 +70,7 @@ namespace abp

    FinalPage::~FinalPage()
    {
        disposeOnce();
    }

    void FinalPage::dispose()
    {
        m_xLocationController.reset();
        AddressBookSourcePage::dispose();
    }

    bool FinalPage::isValidName() const
@@ -156,9 +150,9 @@ namespace abp
        return true;
    }

    void FinalPage::ActivatePage()
    void FinalPage::Activate()
    {
        AddressBookSourcePage::ActivatePage();
        AddressBookSourcePage::Activate();

        // get the names of all data sources
        ODataSourceContext aContext( getORB() );
@@ -173,9 +167,9 @@ namespace abp
        OnEmbed(*m_xEmbed);
    }

    void FinalPage::DeactivatePage()
    void FinalPage::Deactivate()
    {
        AddressBookSourcePage::DeactivatePage();
        AddressBookSourcePage::Deactivate();

        // default the "next" button, again
        getDialog()->defaultButton( WizardButtonFlags::NEXT );
diff --git a/extensions/source/abpilot/abpfinalpage.hxx b/extensions/source/abpilot/abpfinalpage.hxx
index a4d7330..e919b79 100644
--- a/extensions/source/abpilot/abpfinalpage.hxx
+++ b/extensions/source/abpilot/abpfinalpage.hxx
@@ -48,16 +48,15 @@ namespace abp
    public:
        explicit FinalPage(OAddressBookSourcePilot* pDialog, TabPageParent pPageParent);
        virtual ~FinalPage() override;
        virtual void dispose() override;

    private:
        // OWizardPage overridables
        virtual void        initializePage() override;
        virtual bool        commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) override;

        // TabDialog overridables
        virtual void        ActivatePage() override;
        virtual void        DeactivatePage() override;
        // BuilderPage overridables
        virtual void        Activate() override;
        virtual void        Deactivate() override;

        // OImportPage overridables
        virtual bool        canAdvance() const override;
diff --git a/extensions/source/abpilot/abspage.cxx b/extensions/source/abpilot/abspage.cxx
index 646bec4..640fa30 100644
--- a/extensions/source/abpilot/abspage.cxx
+++ b/extensions/source/abpilot/abspage.cxx
@@ -35,15 +35,15 @@ namespace abp
    {
    }

    void AddressBookSourcePage::ActivatePage()
    void AddressBookSourcePage::Activate()
    {
        AddressBookSourcePage_Base::ActivatePage();
        AddressBookSourcePage_Base::Activate();
        m_pDialog->updateTravelUI();
    }

    void AddressBookSourcePage::DeactivatePage()
    void AddressBookSourcePage::Deactivate()
    {
        AddressBookSourcePage_Base::DeactivatePage();
        AddressBookSourcePage_Base::Deactivate();
        m_pDialog->enableButtons(WizardButtonFlags::NEXT, true);
    }

diff --git a/extensions/source/abpilot/abspage.hxx b/extensions/source/abpilot/abspage.hxx
index 9c8816f..a7298e1 100644
--- a/extensions/source/abpilot/abspage.hxx
+++ b/extensions/source/abpilot/abspage.hxx
@@ -48,9 +48,9 @@ namespace abp
        AddressSettings&        getSettings();
        const AddressSettings&  getSettings() const;

        // TabDialog overridables
        virtual void        ActivatePage() override;
        virtual void        DeactivatePage() override;
        // BuilderPage overridables
        virtual void        Activate() override;
        virtual void        Deactivate() override;
    };
}   // namespace abp

diff --git a/extensions/source/abpilot/abspilot.cxx b/extensions/source/abpilot/abspilot.cxx
index 02eca7b..231adb5 100644
--- a/extensions/source/abpilot/abspilot.cxx
+++ b/extensions/source/abpilot/abspilot.cxx
@@ -366,31 +366,31 @@ namespace abp
        return m_aNewDataSource.connect(m_xAssistant.get());
    }

    VclPtr<TabPage> OAddressBookSourcePilot::createPage(WizardState _nState)
    std::unique_ptr<BuilderPage> OAddressBookSourcePilot::createPage(WizardState _nState)
    {
        OString sIdent(OString::number(_nState));
        weld::Container* pPageContainer = m_xAssistant->append_page(sIdent);
        // TODO eventually pass DialogController as distinct argument instead of bundling into TabPageParent
        TabPageParent aParent(pPageContainer, this);

        VclPtr<vcl::OWizardPage> pRet;
        std::unique_ptr<vcl::OWizardPage> xRet;

        switch (_nState)
        {
            case STATE_SELECT_ABTYPE:
                pRet = VclPtr<TypeSelectionPage>::Create( this, aParent );
                xRet = std::make_unique<TypeSelectionPage>( this, aParent );
                break;
            case STATE_INVOKE_ADMIN_DIALOG:
                pRet = VclPtr<AdminDialogInvokationPage>::Create( this, aParent );
                xRet = std::make_unique<AdminDialogInvokationPage>( this, aParent );
                break;
            case STATE_TABLE_SELECTION:
                pRet = VclPtr<TableSelectionPage>::Create( this, aParent );
                xRet = std::make_unique<TableSelectionPage>( this, aParent );
                break;
            case STATE_MANUAL_FIELD_MAPPING:
                pRet = VclPtr<FieldMappingPage>::Create( this, aParent );
                xRet = std::make_unique<FieldMappingPage>( this, aParent );
                break;
            case STATE_FINAL_CONFIRM:
                pRet = VclPtr<FinalPage>::Create( this, aParent );
                xRet = std::make_unique<FinalPage>( this, aParent );
                break;
            default:
                assert(false && "OAddressBookSourcePilot::createPage: invalid state!");
@@ -399,7 +399,7 @@ namespace abp

        m_xAssistant->set_page_title(sIdent, getStateDisplayName(_nState));

        return pRet;
        return xRet;
    }

    void OAddressBookSourcePilot::impl_updateRoadmap( AddressSourceType _eType )
diff --git a/extensions/source/abpilot/abspilot.hxx b/extensions/source/abpilot/abspilot.hxx
index 6f274dc..f959af2 100644
--- a/extensions/source/abpilot/abspilot.hxx
+++ b/extensions/source/abpilot/abspilot.hxx
@@ -64,7 +64,7 @@ namespace abp

    private:
        // OWizardMachine overridables
        virtual VclPtr<TabPage>     createPage( WizardState _nState ) override;
        virtual std::unique_ptr<BuilderPage> createPage( WizardState _nState ) override;
        virtual void                enterState( WizardState _nState ) override;
        virtual bool                prepareLeaveCurrentState( CommitPageReason _eReason ) override;
        virtual bool                onFinish() override;
diff --git a/extensions/source/abpilot/admininvokationpage.cxx b/extensions/source/abpilot/admininvokationpage.cxx
index 5658677..f1a2127 100644
--- a/extensions/source/abpilot/admininvokationpage.cxx
+++ b/extensions/source/abpilot/admininvokationpage.cxx
@@ -35,9 +35,9 @@ namespace abp
    {
    }

    void AdminDialogInvokationPage::ActivatePage()
    void AdminDialogInvokationPage::Activate()
    {
        AddressBookSourcePage::ActivatePage();
        AddressBookSourcePage::Activate();
        m_xInvokeAdminDialog->grab_focus();
    }

diff --git a/extensions/source/abpilot/admininvokationpage.hxx b/extensions/source/abpilot/admininvokationpage.hxx
index c29b3da..b5dcaae 100644
--- a/extensions/source/abpilot/admininvokationpage.hxx
+++ b/extensions/source/abpilot/admininvokationpage.hxx
@@ -34,8 +34,10 @@ namespace abp
        explicit AdminDialogInvokationPage(OAddressBookSourcePilot* pDialog, TabPageParent pPageParent);
        virtual ~AdminDialogInvokationPage() override;
    private:
        // TabDialog overridables
        virtual void        ActivatePage() override;
        // BuilderPage overridables
        virtual void        Activate() override;

        // OWizard overridables
        virtual void        initializePage() override;

        // OImportPage overridables
diff --git a/extensions/source/abpilot/fieldmappingpage.cxx b/extensions/source/abpilot/fieldmappingpage.cxx
index 93a2ca7..54e2ab8 100644
--- a/extensions/source/abpilot/fieldmappingpage.cxx
+++ b/extensions/source/abpilot/fieldmappingpage.cxx
@@ -37,9 +37,9 @@ namespace abp
    {
    }

    void FieldMappingPage::ActivatePage()
    void FieldMappingPage::Activate()
    {
        AddressBookSourcePage::ActivatePage();
        AddressBookSourcePage::Activate();
        m_xInvokeDialog->grab_focus();
    }

diff --git a/extensions/source/abpilot/fieldmappingpage.hxx b/extensions/source/abpilot/fieldmappingpage.hxx
index 8aaebbe..63b5b215 100644
--- a/extensions/source/abpilot/fieldmappingpage.hxx
+++ b/extensions/source/abpilot/fieldmappingpage.hxx
@@ -36,8 +36,8 @@ namespace abp
        // OWizardPage overridables
        virtual void        initializePage() override;

        // TabDialog overridables
        virtual void        ActivatePage() override;
        // BuilderPage overridables
        virtual void        Activate() override;

        DECL_LINK(OnInvokeDialog, weld::Button&, void);

diff --git a/extensions/source/abpilot/tableselectionpage.cxx b/extensions/source/abpilot/tableselectionpage.cxx
index 3d56a33..a897326 100644
--- a/extensions/source/abpilot/tableselectionpage.cxx
+++ b/extensions/source/abpilot/tableselectionpage.cxx
@@ -39,9 +39,9 @@ namespace abp
    {
    }

    void TableSelectionPage::ActivatePage()
    void TableSelectionPage::Activate()
    {
        AddressBookSourcePage::ActivatePage();
        AddressBookSourcePage::Activate();

        m_xTableList->grab_focus();
    }
diff --git a/extensions/source/abpilot/tableselectionpage.hxx b/extensions/source/abpilot/tableselectionpage.hxx
index f25258b..35f2e40 100644
--- a/extensions/source/abpilot/tableselectionpage.hxx
+++ b/extensions/source/abpilot/tableselectionpage.hxx
@@ -37,8 +37,8 @@ namespace abp
        virtual void        initializePage() override;
        virtual bool        commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) override;

        // TabDialog overridables
        virtual void        ActivatePage() override;
        // BuilderPage overridables
        virtual void        Activate() override;

        // OImportPage overridables
        virtual bool        canAdvance() const override;
diff --git a/extensions/source/abpilot/typeselectionpage.cxx b/extensions/source/abpilot/typeselectionpage.cxx
index a9f68fd..394b6889 100644
--- a/extensions/source/abpilot/typeselectionpage.cxx
+++ b/extensions/source/abpilot/typeselectionpage.cxx
@@ -134,21 +134,15 @@ namespace abp

    TypeSelectionPage::~TypeSelectionPage()
    {
        disposeOnce();
    }

    void TypeSelectionPage::dispose()
    {
        for (auto & elem : m_aAllTypes)
        {
            elem.m_bVisible = false;
        }
        AddressBookSourcePage::dispose();
    }

    void TypeSelectionPage::ActivatePage()
    void TypeSelectionPage::Activate()
    {
        AddressBookSourcePage::ActivatePage();
        AddressBookSourcePage::Activate();

        for (auto const& elem : m_aAllTypes)
        {
@@ -162,9 +156,9 @@ namespace abp
        getDialog()->enableButtons(WizardButtonFlags::PREVIOUS, false);
    }

    void TypeSelectionPage::DeactivatePage()
    void TypeSelectionPage::Deactivate()
    {
        AddressBookSourcePage::DeactivatePage();
        AddressBookSourcePage::Deactivate();
        getDialog()->enableButtons(WizardButtonFlags::PREVIOUS, true);
    }

diff --git a/extensions/source/abpilot/typeselectionpage.hxx b/extensions/source/abpilot/typeselectionpage.hxx
index cf5c537..ef8a609 100644
--- a/extensions/source/abpilot/typeselectionpage.hxx
+++ b/extensions/source/abpilot/typeselectionpage.hxx
@@ -57,7 +57,6 @@ namespace abp
    public:
        explicit TypeSelectionPage(OAddressBookSourcePilot* pDialog, TabPageParent pPageParent);
        virtual ~TypeSelectionPage() override;
        virtual void        dispose() override;

        // retrieves the currently selected type
        AddressSourceType   getSelectedType() const;
@@ -67,9 +66,9 @@ namespace abp
        virtual void        initializePage() override;
        virtual bool        commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) override;

        // TabDialog overridables
        virtual void        ActivatePage() override;
        virtual void        DeactivatePage() override;
        // BuilderPage overridables
        virtual void        Activate() override;
        virtual void        Deactivate() override;

        // OImportPage overridables
        virtual bool        canAdvance() const override;
diff --git a/extensions/source/dbpilots/commonpagesdbp.cxx b/extensions/source/dbpilots/commonpagesdbp.cxx
index fdd5c727..79d8c19 100644
--- a/extensions/source/dbpilots/commonpagesdbp.cxx
+++ b/extensions/source/dbpilots/commonpagesdbp.cxx
@@ -83,9 +83,9 @@ namespace dbp
    {
    }

    void OTableSelectionPage::ActivatePage()
    void OTableSelectionPage::Activate()
    {
        OControlWizardPage::ActivatePage();
        OControlWizardPage::Activate();
        m_xDatasource->grab_focus();
    }

@@ -392,11 +392,11 @@ namespace dbp
        m_pList->set_sensitive(m_pYes->get_active());
    }

    void OMaybeListSelectionPage::ActivatePage()
    void OMaybeListSelectionPage::Activate()
    {
        OControlWizardPage::ActivatePage();
        OControlWizardPage::Activate();

        DBG_ASSERT(m_pYes, "OMaybeListSelectionPage::ActivatePage: no controls announced!");
        DBG_ASSERT(m_pYes, "OMaybeListSelectionPage::Activate: no controls announced!");
        if (m_pYes->get_active())
            m_pList->grab_focus();
        else
@@ -410,7 +410,7 @@ namespace dbp
        , m_xStoreNo(m_xBuilder->weld_radio_button("noRadiobutton"))
        , m_xStoreWhere(m_xBuilder->weld_combo_box("storeInFieldCombobox"))
    {
        SetText(compmodule::ModuleRes(RID_STR_OPTION_DB_FIELD_TITLE));
        SetPageTitle(compmodule::ModuleRes(RID_STR_OPTION_DB_FIELD_TITLE));

        announceControls(*m_xStoreYes, *m_xStoreNo, *m_xStoreWhere);
    }
@@ -429,7 +429,6 @@ namespace dbp
        implInitialize(getDBFieldSetting());
    }


    bool ODBFieldPage::commitPage( ::vcl::WizardTypes::CommitPageReason _eReason )
    {
        if (!OMaybeListSelectionPage::commitPage(_eReason))
diff --git a/extensions/source/dbpilots/commonpagesdbp.hxx b/extensions/source/dbpilots/commonpagesdbp.hxx
index 66a9ea4..70b750d 100644
--- a/extensions/source/dbpilots/commonpagesdbp.hxx
+++ b/extensions/source/dbpilots/commonpagesdbp.hxx
@@ -42,8 +42,8 @@ namespace dbp
        virtual ~OTableSelectionPage() override;

    private:
        // TabPage overridables
        void ActivatePage() override;
        // BuilderPage overridables
        void Activate() override;

        // OWizardPage overridables
        virtual void        initializePage() override;
@@ -73,8 +73,8 @@ namespace dbp
    protected:
        DECL_LINK( OnRadioSelected, weld::Button&, void );

        // TabPage overridables
        void ActivatePage() override;
        // BuilderPage overridables
        void Activate() override;

        // own helper
        void    announceControls(
diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx
index ba4dc94..e8aaed7 100644
--- a/extensions/source/dbpilots/controlwizard.cxx
+++ b/extensions/source/dbpilots/controlwizard.cxx
@@ -43,8 +43,8 @@
#include <tools/urlobj.hxx>
#include <osl/diagnose.h>

#define WINDOW_SIZE_X   240
#define WINDOW_SIZE_Y   185
#define WIZARD_SIZE_X   60
#define WIZARD_SIZE_Y   23

namespace dbp
{
@@ -77,8 +77,8 @@ namespace dbp
        : OControlWizardPage_Base(pPageParent, rUIXMLDescription, rID)
        , m_pDialog(pDialog)
    {
        ::Size aPageSize(LogicToPixel(::Size(WINDOW_SIZE_X, WINDOW_SIZE_Y), MapMode(MapUnit::MapAppFont)));
        m_xContainer->set_size_request(aPageSize.Width(), aPageSize.Height());
        m_xContainer->set_size_request(m_xContainer->get_approximate_digit_width() * WIZARD_SIZE_X,
                                       m_xContainer->get_text_height() * WIZARD_SIZE_Y);
    }

    OControlWizardPage::~OControlWizardPage()
diff --git a/extensions/source/dbpilots/controlwizard.hxx b/extensions/source/dbpilots/controlwizard.hxx
index 884992b..d859035 100644
--- a/extensions/source/dbpilots/controlwizard.hxx
+++ b/extensions/source/dbpilots/controlwizard.hxx
@@ -140,9 +140,6 @@ namespace dbp
        void implDetermineForm();
        void implDeterminePage();
        void implDetermineShape();

        // made private. Not to be used by derived (or external) classes
        using OControlWizard_Base::ActivatePage;
    };


diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx
index 7da39e0..2fc497e 100644
--- a/extensions/source/dbpilots/gridwizard.cxx
+++ b/extensions/source/dbpilots/gridwizard.cxx
@@ -216,7 +216,7 @@ namespace dbp
        }
    }

    VclPtr<TabPage> OGridWizard::createPage(WizardState _nState)
    std::unique_ptr<BuilderPage> OGridWizard::createPage(WizardState _nState)
    {
        OString sIdent(OString::number(_nState));
        weld::Container* pPageContainer = m_xAssistant->append_page(sIdent);
@@ -226,12 +226,12 @@ namespace dbp
        switch (_nState)
        {
            case GW_STATE_DATASOURCE_SELECTION:
                return VclPtr<OTableSelectionPage>::Create(this, aParent);
                return std::make_unique<OTableSelectionPage>(this, aParent);
            case GW_STATE_FIELDSELECTION:
                return VclPtr<OGridFieldsSelection>::Create(this, aParent);
                return std::make_unique<OGridFieldsSelection>(this, aParent);
        }

        return VclPtr<TabPage>();
        return nullptr;
    }

    vcl::WizardTypes::WizardState OGridWizard::determineNextState( WizardState _nCurrentState ) const
@@ -309,9 +309,9 @@ namespace dbp
    {
    }

    void OGridFieldsSelection::ActivatePage()
    void OGridFieldsSelection::Activate()
    {
        OGridPage::ActivatePage();
        OGridPage::Activate();
        m_xExistFields->grab_focus();
    }

diff --git a/extensions/source/dbpilots/gridwizard.hxx b/extensions/source/dbpilots/gridwizard.hxx
index a0756f6..c96a86d 100644
--- a/extensions/source/dbpilots/gridwizard.hxx
+++ b/extensions/source/dbpilots/gridwizard.hxx
@@ -47,7 +47,7 @@ namespace dbp

    private:
        // OWizardMachine overridables
        virtual VclPtr<TabPage>     createPage( WizardState _nState ) override;
        virtual std::unique_ptr<BuilderPage> createPage( WizardState _nState ) override;
        virtual WizardState         determineNextState( WizardState _nCurrentState ) const override;
        virtual void                enterState( WizardState _nState ) override;
        virtual bool                leaveState( WizardState _nState ) override;
@@ -83,8 +83,8 @@ namespace dbp
        virtual ~OGridFieldsSelection() override;

    private:
        // TabPage overridables
        virtual void ActivatePage() override;
        // BuilderPage overridables
        virtual void Activate() override;

        // OWizardPage overridables
        virtual void        initializePage() override;
diff --git a/extensions/source/dbpilots/groupboxwiz.cxx b/extensions/source/dbpilots/groupboxwiz.cxx
index 8ec840f..031433b 100644
--- a/extensions/source/dbpilots/groupboxwiz.cxx
+++ b/extensions/source/dbpilots/groupboxwiz.cxx
@@ -60,7 +60,7 @@ namespace dbp
        return FormComponentType::GROUPBOX == _nClassId;
    }

    VclPtr<TabPage> OGroupBoxWizard::createPage(::vcl::WizardTypes::WizardState _nState)
    std::unique_ptr<BuilderPage> OGroupBoxWizard::createPage(::vcl::WizardTypes::WizardState _nState)
    {
        OString sIdent(OString::number(_nState));
        weld::Container* pPageContainer = m_xAssistant->append_page(sIdent);
@@ -70,19 +70,19 @@ namespace dbp
        switch (_nState)
        {
            case GBW_STATE_OPTIONLIST:
                return VclPtr<ORadioSelectionPage>::Create(this, aParent);
                return std::make_unique<ORadioSelectionPage>(this, aParent);

            case GBW_STATE_DEFAULTOPTION:
                return VclPtr<ODefaultFieldSelectionPage>::Create(this, aParent);
                return std::make_unique<ODefaultFieldSelectionPage>(this, aParent);

            case GBW_STATE_OPTIONVALUES:
                return VclPtr<OOptionValuesPage>::Create(this, aParent);
                return std::make_unique<OOptionValuesPage>(this, aParent);

            case GBW_STATE_DBFIELD:
                return VclPtr<OOptionDBFieldPage>::Create(this, aParent);
                return std::make_unique<OOptionDBFieldPage>(this, aParent);

            case GBW_STATE_FINALIZE:
                return VclPtr<OFinalizeGBWPage>::Create(this, aParent);
                return std::make_unique<OFinalizeGBWPage>(this, aParent);
        }

        return nullptr;
@@ -196,9 +196,9 @@ namespace dbp
    {
    }

    void ORadioSelectionPage::ActivatePage()
    void ORadioSelectionPage::Activate()
    {
        OGBWPage::ActivatePage();
        OGBWPage::Activate();
        m_xRadioName->grab_focus();
    }

@@ -353,9 +353,9 @@ namespace dbp
        implTraveledOptions();
    }

    void OOptionValuesPage::ActivatePage()
    void OOptionValuesPage::Activate()
    {
        OGBWPage::ActivatePage();
        OGBWPage::Activate();
        m_xValue->grab_focus();
    }

@@ -432,9 +432,9 @@ namespace dbp
    {
    }

    void OFinalizeGBWPage::ActivatePage()
    void OFinalizeGBWPage::Activate()
    {
        OGBWPage::ActivatePage();
        OGBWPage::Activate();
        m_xName->grab_focus();
    }

diff --git a/extensions/source/dbpilots/groupboxwiz.hxx b/extensions/source/dbpilots/groupboxwiz.hxx
index 903ac01..19a10f9 100644
--- a/extensions/source/dbpilots/groupboxwiz.hxx
+++ b/extensions/source/dbpilots/groupboxwiz.hxx
@@ -55,7 +55,7 @@ namespace dbp

    private:
        // OWizardMachine overridables
        virtual VclPtr<TabPage>     createPage( WizardState _nState ) override;
        virtual std::unique_ptr<BuilderPage> createPage( WizardState _nState ) override;
        virtual WizardState         determineNextState( WizardState _nCurrentState ) const override;
        virtual void                enterState( WizardState _nState ) override;
        virtual bool                onFinish() override;
@@ -87,8 +87,8 @@ namespace dbp
        virtual ~ORadioSelectionPage() override;

    private:
        // TabPage overridables
        void ActivatePage() override;
        // BuilderPage overridables
        void Activate() override;

        // OWizardPage overridables
        virtual void        initializePage() override;
@@ -134,8 +134,8 @@ namespace dbp
        virtual ~OOptionValuesPage() override;

    private:
        // TabPage overridables
        void ActivatePage() override;
        // BuilderPage overridables
        void Activate() override;

        // OWizardPage overridables
        virtual void        initializePage() override;
@@ -165,8 +165,8 @@ namespace dbp
        virtual ~OFinalizeGBWPage() override;

    private:
        // TabPage overridables
        void ActivatePage() override;
        // BuilderPage overridables
        void Activate() override;

        // OWizardPage overridables
        virtual void        initializePage() override;
diff --git a/extensions/source/dbpilots/listcombowizard.cxx b/extensions/source/dbpilots/listcombowizard.cxx
index 3c6e0d9..55107a1 100644
--- a/extensions/source/dbpilots/listcombowizard.cxx
+++ b/extensions/source/dbpilots/listcombowizard.cxx
@@ -83,7 +83,7 @@ namespace dbp
        return false;
    }

    VclPtr<TabPage> OListComboWizard::createPage(WizardState _nState)
    std::unique_ptr<BuilderPage> OListComboWizard::createPage(WizardState _nState)
    {
        OString sIdent(OString::number(_nState));
        weld::Container* pPageContainer = m_xAssistant->append_page(sIdent);
@@ -93,18 +93,18 @@ namespace dbp
        switch (_nState)
        {
            case LCW_STATE_DATASOURCE_SELECTION:
                return VclPtr<OTableSelectionPage>::Create(this, aParent);
                return std::make_unique<OTableSelectionPage>(this, aParent);
            case LCW_STATE_TABLESELECTION:
                return VclPtr<OContentTableSelection>::Create(this, aParent);
                return std::make_unique<OContentTableSelection>(this, aParent);
            case LCW_STATE_FIELDSELECTION:
                return VclPtr<OContentFieldSelection>::Create(this, aParent);
                return std::make_unique<OContentFieldSelection>(this, aParent);
            case LCW_STATE_FIELDLINK:
                return VclPtr<OLinkFieldsPage>::Create(this, aParent);
                return std::make_unique<OLinkFieldsPage>(this, aParent);
            case LCW_STATE_COMBODBFIELD:
                return VclPtr<OComboDBFieldPage>::Create(this, aParent);
                return std::make_unique<OComboDBFieldPage>(this, aParent);
        }

        return VclPtr<TabPage>();
        return nullptr;
    }

    vcl::WizardTypes::WizardState OListComboWizard::determineNextState( WizardState _nCurrentState ) const
@@ -276,9 +276,9 @@ namespace dbp
    {
    }

    void OContentTableSelection::ActivatePage()
    void OContentTableSelection::Activate()
    {
        OLCPage::ActivatePage();
        OLCPage::Activate();
        m_xSelectTable->grab_focus();
    }

@@ -407,9 +407,9 @@ namespace dbp
    {
    }

    void OLinkFieldsPage::ActivatePage()
    void OLinkFieldsPage::Activate()
    {
        OLCPage::ActivatePage();
        OLCPage::Activate();
        m_xValueListField->grab_focus();
    }

@@ -469,9 +469,9 @@ namespace dbp
        return static_cast<OListComboWizard*>(getDialog())->getSettings().sLinkedFormField;
    }

    void OComboDBFieldPage::ActivatePage()
    void OComboDBFieldPage::Activate()
    {
        ODBFieldPage::ActivatePage();
        ODBFieldPage::Activate();
        getDialog()->enableButtons(WizardButtonFlags::FINISH, true);
    }

diff --git a/extensions/source/dbpilots/listcombowizard.hxx b/extensions/source/dbpilots/listcombowizard.hxx
index 93f373e..caa2335f 100644
--- a/extensions/source/dbpilots/listcombowizard.hxx
+++ b/extensions/source/dbpilots/listcombowizard.hxx
@@ -62,7 +62,7 @@ namespace dbp

    private:
        // OWizardMachine overridables
        virtual VclPtr<TabPage>     createPage( WizardState _nState ) override;
        virtual std::unique_ptr<BuilderPage> createPage( WizardState _nState ) override;
        virtual WizardState         determineNextState( WizardState _nCurrentState ) const override;
        virtual void                enterState( WizardState _nState ) override;
        virtual bool                leaveState( WizardState _nState ) override;
@@ -101,8 +101,8 @@ namespace dbp
        virtual ~OContentTableSelection() override;

    private:
        // TabPage overridables
        virtual void ActivatePage() override;
        // BuilderPage overridables
        virtual void Activate() override;

        // OWizardPage overridables
        virtual void        initializePage() override;
@@ -143,8 +143,8 @@ namespace dbp
        virtual ~OLinkFieldsPage() override;

    private:
        // TabPage overridables
        virtual void ActivatePage() override;
        // BuilderPage overridables
        virtual void Activate() override;

        // OWizardPage overridables
        virtual void        initializePage() override;
@@ -162,8 +162,8 @@ namespace dbp
        explicit OComboDBFieldPage(OControlWizard* pParent, TabPageParent pPageParent);

    protected:
        // TabPage overridables
        virtual void ActivatePage() override;
        // BuilderPage overridables
        virtual void Activate() override;

        // OWizardPage overridables
        virtual bool    canAdvance() const override;
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index 68775d5..128307f 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -2721,8 +2721,7 @@ namespace pcr
                throw RuntimeException();   // caught below

            TabPageParent aParent(aDialog.get_content_area(), &aDialog);
            VclPtr<SfxTabPage> xPage = (*fnCreatePage)(aParent, &aCoreSet);
            aDialog.SetTabPage(xPage);
            aDialog.SetTabPage((*fnCreatePage)(aParent, &aCoreSet));

            _rClearBeforeDialog.clear();
            if ( RET_OK == aDialog.run() )
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index e711b5f..8d59562 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -683,10 +683,10 @@ void ImpPDFTabGeneralPage::GetFilterConfigItem( ImpPDFTabDialog* pParent )
    pParent->mbAllowDuplicateFieldNames = mxCbAllowDuplicateFieldNames->get_active();
}

VclPtr<SfxTabPage> ImpPDFTabGeneralPage::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> ImpPDFTabGeneralPage::Create( TabPageParent pParent,
                                                 const SfxItemSet* rAttrSet)
{
    return VclPtr<ImpPDFTabGeneralPage>::Create(pParent, *rAttrSet);
    return std::make_unique<ImpPDFTabGeneralPage>(pParent, *rAttrSet);
}

IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleAllHdl, weld::ToggleButton&, void)
@@ -841,9 +841,9 @@ ImpPDFTabOpnFtrPage::~ImpPDFTabOpnFtrPage()
{
}

VclPtr<SfxTabPage> ImpPDFTabOpnFtrPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
std::unique_ptr<SfxTabPage> ImpPDFTabOpnFtrPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
{
    return VclPtr<ImpPDFTabOpnFtrPage>::Create(pParent, *rAttrSet);
    return std::make_unique<ImpPDFTabOpnFtrPage>(pParent, *rAttrSet);
}

void ImpPDFTabOpnFtrPage::GetFilterConfigItem( ImpPDFTabDialog* pParent  )
@@ -996,10 +996,10 @@ IMPL_LINK_NOARG( ImpPDFTabViewerPage, ToggleRbBookmarksHdl, weld::ToggleButton&,
    m_xNumBookmarkLevels->set_sensitive(m_xRbVisibleBookmarkLevels->get_active());
}

VclPtr<SfxTabPage> ImpPDFTabViewerPage::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> ImpPDFTabViewerPage::Create( TabPageParent pParent,
                                                const SfxItemSet* rAttrSet)
{
    return VclPtr<ImpPDFTabViewerPage>::Create(pParent, *rAttrSet);
    return std::make_unique<ImpPDFTabViewerPage>(pParent, *rAttrSet);
}

void ImpPDFTabViewerPage::GetFilterConfigItem( ImpPDFTabDialog* pParent  )
@@ -1079,9 +1079,9 @@ ImpPDFTabSecurityPage::~ImpPDFTabSecurityPage()
{
}

VclPtr<SfxTabPage> ImpPDFTabSecurityPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
std::unique_ptr<SfxTabPage> ImpPDFTabSecurityPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
{
    return VclPtr<ImpPDFTabSecurityPage>::Create(pParent, *rAttrSet);
    return std::make_unique<ImpPDFTabSecurityPage>(pParent, *rAttrSet);
}

void ImpPDFTabSecurityPage::GetFilterConfigItem( ImpPDFTabDialog* pParent  )
@@ -1290,9 +1290,9 @@ ImpPDFTabLinksPage::~ImpPDFTabLinksPage()
{
}

VclPtr<SfxTabPage> ImpPDFTabLinksPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
std::unique_ptr<SfxTabPage> ImpPDFTabLinksPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
{
    return VclPtr<ImpPDFTabLinksPage>::Create(pParent, *rAttrSet);
    return std::make_unique<ImpPDFTabLinksPage>(pParent, *rAttrSet);
}

void ImpPDFTabLinksPage::GetFilterConfigItem( ImpPDFTabDialog* pParent  )
@@ -1528,10 +1528,10 @@ IMPL_LINK_NOARG(ImpPDFTabSigningPage, ClickmaPbSignCertClear, weld::Button&, voi
    mxLBSignTSA->set_sensitive(false);
}

VclPtr<SfxTabPage> ImpPDFTabSigningPage::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> ImpPDFTabSigningPage::Create( TabPageParent pParent,
                                                 const SfxItemSet* rAttrSet)
{
    return VclPtr<ImpPDFTabSigningPage>::Create(pParent, *rAttrSet);
    return std::make_unique<ImpPDFTabSigningPage>(pParent, *rAttrSet);
}

void ImpPDFTabSigningPage::GetFilterConfigItem( ImpPDFTabDialog* pParent  )
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index c1a9543..7eb512f 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -225,7 +225,7 @@ public:
    ImpPDFTabGeneralPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual                     ~ImpPDFTabGeneralPage() override;

    static VclPtr<SfxTabPage>   Create( TabPageParent pParent, const SfxItemSet* rAttrSet);
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet);

    void                        GetFilterConfigItem(ImpPDFTabDialog* paParent);
    void                        SetFilterConfigItem(ImpPDFTabDialog* paParent);
@@ -262,7 +262,7 @@ public:
    ImpPDFTabOpnFtrPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual                     ~ImpPDFTabOpnFtrPage() override;

    static VclPtr<SfxTabPage>   Create( TabPageParent pParent, const SfxItemSet* rAttrSet );
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet );

    void                        GetFilterConfigItem( ImpPDFTabDialog* paParent);
    void                        SetFilterConfigItem( const ImpPDFTabDialog* paParent );
@@ -291,7 +291,7 @@ public:
    ImpPDFTabViewerPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual                     ~ImpPDFTabViewerPage() override;

    static VclPtr<SfxTabPage>   Create( TabPageParent pParent, const SfxItemSet* rAttrSet );
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet );

    void                        GetFilterConfigItem( ImpPDFTabDialog* paParent);
    void                        SetFilterConfigItem( const ImpPDFTabDialog* paParent );
@@ -339,7 +339,7 @@ public:
    ImpPDFTabSecurityPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual                     ~ImpPDFTabSecurityPage() override;

    static VclPtr<SfxTabPage>   Create(TabPageParent pParent, const SfxItemSet* rAttrSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet);

    void                        GetFilterConfigItem( ImpPDFTabDialog* paParent);
    void                        SetFilterConfigItem( const ImpPDFTabDialog* paParent );
@@ -368,7 +368,7 @@ public:
    ImpPDFTabLinksPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual                     ~ImpPDFTabLinksPage() override;

    static VclPtr<SfxTabPage>   Create(TabPageParent pParent, const SfxItemSet* rAttrSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet);

    void                        GetFilterConfigItem( ImpPDFTabDialog* paParent);
    void                        SetFilterConfigItem( const ImpPDFTabDialog* paParent );
@@ -397,7 +397,7 @@ public:
    ImpPDFTabSigningPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual                     ~ImpPDFTabSigningPage() override;

    static VclPtr<SfxTabPage>   Create( TabPageParent pParent, const SfxItemSet* rAttrSet );
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet );

    void                        GetFilterConfigItem( ImpPDFTabDialog* paParent);
    void                        SetFilterConfigItem( const ImpPDFTabDialog* paParent );
diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index 948b52f..c01d6bd 100644
--- a/include/sfx2/basedlgs.hxx
+++ b/include/sfx2/basedlgs.hxx
@@ -182,7 +182,7 @@ public:

    virtual             ~SfxSingleTabDialogController() override;

    void                SetTabPage(SfxTabPage* pTabPage);
    void                SetTabPage(std::unique_ptr<SfxTabPage> xTabPage);
    SfxTabPage*         GetTabPage() const { return m_xSfxPage.get(); }

    virtual weld::Button& GetOKButton() const override { return *m_xOKBtn; }
@@ -192,7 +192,7 @@ public:
    const SfxItemSet*   GetInputItemSet() const { return m_pInputSet; }

protected:
    VclPtr<SfxTabPage> m_xSfxPage;
    std::unique_ptr<SfxTabPage> m_xSfxPage;
    std::unique_ptr<weld::Container> m_xContainer;
    std::unique_ptr<weld::Button> m_xOKBtn;
    std::unique_ptr<weld::Button> m_xHelpBtn;
diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx
index 87f83f3..caa618f 100644
--- a/include/sfx2/dinfdlg.hxx
+++ b/include/sfx2/dinfdlg.hxx
@@ -200,14 +200,13 @@ private:
    void                ImplCheckPasswordState();

protected:
    virtual ~SfxDocumentPage() override;

    virtual bool        FillItemSet( SfxItemSet* ) override;
    virtual void        Reset( const SfxItemSet* ) override;

public:
    SfxDocumentPage(TabPageParent pParent, const SfxItemSet&);
    static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* );
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* );
    virtual ~SfxDocumentPage() override;

    void                EnableUseUserData();
};
@@ -224,14 +223,13 @@ private:
    std::unique_ptr<weld::TextView> m_xCommentEd;

protected:
    virtual ~SfxDocumentDescPage() override;

    virtual bool            FillItemSet( SfxItemSet* ) override;
    virtual void            Reset( const SfxItemSet* ) override;

public:
    SfxDocumentDescPage(TabPageParent pParent, const SfxItemSet&);
    static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* );
    virtual ~SfxDocumentDescPage() override;
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* );
};

// class SfxDocumentInfoDialog -------------------------------------------
@@ -447,22 +445,18 @@ class SfxCustomPropertiesPage : public SfxTabPage
private:
    DECL_LINK(AddHdl, weld::Button&, void);

    using TabPage::DeactivatePage;

    std::unique_ptr<CustomPropertiesControl> m_xPropertiesCtrl;
    std::unique_ptr<weld::Button> m_xAdd;

protected:
    virtual ~SfxCustomPropertiesPage() override;
    virtual void dispose() override;

    virtual bool        FillItemSet( SfxItemSet* ) override;
    virtual void        Reset( const SfxItemSet* ) override;
    virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;

public:
    SfxCustomPropertiesPage(TabPageParent pParent, const SfxItemSet&);
    static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* );
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* );
    virtual ~SfxCustomPropertiesPage() override;
};

struct CmisValue
@@ -569,7 +563,6 @@ class SfxCmisPropertiesPage : public SfxTabPage
{
private:
    std::unique_ptr<CmisPropertiesControl> m_xPropertiesCtrl;
    using TabPage::DeactivatePage;

protected:
    virtual bool        FillItemSet( SfxItemSet* ) override;
@@ -578,9 +571,8 @@ protected:

public:
    SfxCmisPropertiesPage(TabPageParent pParent, const SfxItemSet&);
    virtual void dispose() override;
    virtual ~SfxCmisPropertiesPage() override;
    static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* );
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet*);
};

#endif // #ifndef _ INCLUDED_SFX2_DINFDLG_HXX
diff --git a/include/sfx2/mgetempl.hxx b/include/sfx2/mgetempl.hxx
index 8676472..1f40b35 100644
--- a/include/sfx2/mgetempl.hxx
+++ b/include/sfx2/mgetempl.hxx
@@ -62,7 +62,7 @@ class SfxManageStyleSheetPage final : public SfxTabPage
    std::unique_ptr<weld::Label> m_xDescFt;
    std::unique_ptr<weld::Label> m_xNameFt;

friend class SfxStyleDialogController;
    friend class SfxStyleDialogController;

    DECL_LINK(GetFocusHdl, weld::Widget&, void);
    DECL_LINK(LoseFocusHdl, weld::Widget&, void);
@@ -74,22 +74,19 @@ friend class SfxStyleDialogController;
    void    UpdateName_Impl(weld::ComboBox*, const OUString &rNew);
    void    SetDescriptionText_Impl();

    virtual ~SfxManageStyleSheetPage() override;
    virtual void dispose() override;

    static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* );
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* );

    virtual bool        FillItemSet(SfxItemSet *) override;
    virtual void        Reset(const SfxItemSet *) override;

    static bool    Execute_Impl( sal_uInt16 nId, const OUString& rStr, sal_uInt16 nFamily );
    using TabPage::ActivatePage;
    virtual void        ActivatePage(const SfxItemSet &) override;
    using TabPage::DeactivatePage;
    virtual DeactivateRC DeactivatePage(SfxItemSet *) override;

public:
    SfxManageStyleSheetPage(TabPageParent pParent, const SfxItemSet &rAttrSet);
    virtual ~SfxManageStyleSheetPage() override;
};

#endif
diff --git a/include/sfx2/module.hxx b/include/sfx2/module.hxx
index c4ad3d8..78d159d 100644
--- a/include/sfx2/module.hxx
+++ b/include/sfx2/module.hxx
@@ -73,7 +73,7 @@ public:
    void                        RegisterChildWindow(std::unique_ptr<SfxChildWinFactory>);
    void                        RegisterStatusBarControl(const SfxStbCtrlFactory&);

    virtual VclPtr<SfxTabPage>  CreateTabPage( sal_uInt16 nId,
    virtual std::unique_ptr<SfxTabPage>  CreateTabPage( sal_uInt16 nId,
                                               TabPageParent pParent,
                                               const SfxItemSet& rSet );
    virtual void                Invalidate(sal_uInt16 nId = 0) override;
diff --git a/include/sfx2/printopt.hxx b/include/sfx2/printopt.hxx
index a30fba1..c6b47b8 100644
--- a/include/sfx2/printopt.hxx
+++ b/include/sfx2/printopt.hxx
@@ -72,7 +72,6 @@ private:

protected:

    using TabPage::DeactivatePage;
    virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;

public:
@@ -82,7 +81,7 @@ public:
    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;

    static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* );
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* );
};

#endif // INCLUDED_SFX2_PRINTOPT_HXX
diff --git a/include/sfx2/prnmon.hxx b/include/sfx2/prnmon.hxx
index 5e87753..298aeac 100644
--- a/include/sfx2/prnmon.hxx
+++ b/include/sfx2/prnmon.hxx
@@ -36,9 +36,9 @@ class SfxPrintOptionsDialog : public weld::GenericDialogController
private:
    std::unique_ptr<SfxPrintOptDlg_Impl>   pDlgImpl;
    std::unique_ptr<SfxItemSet>            pOptions;
    VclPtr<SfxTabPage>      pPage;
    std::unique_ptr<weld::Widget>    m_xHelpBtn;
    std::unique_ptr<weld::Container> m_xContainer;
    std::unique_ptr<SfxTabPage> m_xPage;

    DECL_LINK(HelpRequestHdl, weld::Widget&, bool);
public:
diff --git a/include/sfx2/securitypage.hxx b/include/sfx2/securitypage.hxx
index deb7fe6..14478ea 100644
--- a/include/sfx2/securitypage.hxx
+++ b/include/sfx2/securitypage.hxx
@@ -34,7 +34,7 @@ protected:

public:
    SfxSecurityPage(TabPageParent pParent, const SfxItemSet&);
    static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet*);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet*);
    weld::Builder& GetBuilder() const { return *m_xBuilder; }
};

diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index f8a0f99..1ff48d3 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -24,6 +24,7 @@
#include <sfx2/dllapi.h>
#include <sfx2/basedlgs.hxx>
#include <sal/types.h>
#include <vcl/builderpage.hxx>
#include <vcl/tabpage.hxx>
#include <svl/itempool.hxx>
#include <svl/itemset.hxx>
@@ -31,7 +32,7 @@

class SfxTabPage;

typedef VclPtr<SfxTabPage> (*CreateTabPage)(TabPageParent pParent, const SfxItemSet *rAttrSet);
typedef std::unique_ptr<SfxTabPage> (*CreateTabPage)(TabPageParent pParent, const SfxItemSet *rAttrSet);
typedef const sal_uInt16*     (*GetTabPageRanges)(); // provides international Which-value
struct TabPageImpl;

@@ -162,7 +163,7 @@ namespace o3tl {
    template<> struct typed_flags<DeactivateRC> : is_typed_flags<DeactivateRC, 0x03> {};
}

class SFX2_DLLPUBLIC SfxTabPage: public TabPage
class SFX2_DLLPUBLIC SfxTabPage : public BuilderPage
{
friend class SfxTabDialog;
friend class SfxTabDialogController;
@@ -174,10 +175,6 @@ private:
    std::unique_ptr< TabPageImpl >        pImpl;

protected:
    std::unique_ptr<weld::Builder> m_xBuilder;
    std::unique_ptr<weld::Container> m_xContainer;

protected:
    SfxTabPage(TabPageParent pParent, const OUString& rUIXMLDescription, const OString& rID, const SfxItemSet *rAttrSet);

    sal_uInt16          GetWhich( sal_uInt16 nSlot, bool bDeep = true ) const
@@ -193,12 +190,10 @@ public:
    void                SetDialogController(SfxOkDialogController* pDialog);
public:
    virtual             ~SfxTabPage() override;
    virtual void        dispose() override;

    void set_visible(bool bVisible)
    {
        m_xContainer->set_visible(bVisible);
        Show(bVisible);
    }

    const SfxItemSet&   GetItemSet() const { return *pSet; }
@@ -211,8 +206,6 @@ public:
    void                SetExchangeSupport()
                            { bHasExchangeSupport = true; }

        using TabPage::ActivatePage;
        using TabPage::DeactivatePage;
    virtual void            ActivatePage( const SfxItemSet& );
    virtual DeactivateRC    DeactivatePage( SfxItemSet* pSet );
    void                    SetUserData(const OUString& rString)
@@ -233,7 +226,9 @@ public:

    const SfxItemSet* GetDialogExampleSet() const;

    OString         GetConfigId() const;
    OString         GetHelpId() const;
    OString         GetConfigId() const { return GetHelpId(); }
    bool            IsVisible() const { return m_xContainer->get_visible(); }

    //TODO rename to GetFrameWeld when SfxTabPage doesn't inherit from anything
    weld::Window*   GetDialogFrameWeld() const;
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index 9d3312b..0463c3a 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -237,7 +237,7 @@ public:
    virtual SfxPrinter*         GetPrinter( bool bCreate = false );
    virtual sal_uInt16          SetPrinter( SfxPrinter *pNewPrinter, SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL );
    virtual bool                HasPrintOptionsPage() const;
    virtual VclPtr<SfxTabPage>  CreatePrintOptionsPage(TabPageParent pParent, const SfxItemSet &rOptions);
    virtual std::unique_ptr<SfxTabPage>  CreatePrintOptionsPage(TabPageParent pParent, const SfxItemSet &rOptions);
    Printer*                    GetActivePrinter() const;

    // Working set
diff --git a/include/svx/dlgctrl.hxx b/include/svx/dlgctrl.hxx
index 3f31a82..f2053d4 100644
--- a/include/svx/dlgctrl.hxx
+++ b/include/svx/dlgctrl.hxx
@@ -74,7 +74,7 @@ class SvxPixelCtlAccessible;
class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxRectCtl : public weld::CustomWidgetController
{
private:
    VclPtr<SvxTabPage> m_pPage;
    SvxTabPage* m_pPage;

    SVX_DLLPRIVATE static void      InitSettings(vcl::RenderContext& rRenderContext);
    SVX_DLLPRIVATE void             InitRectBitmap();
@@ -148,7 +148,7 @@ private:
    static sal_uInt16 constexpr nLines = 8;
    static sal_uInt16 constexpr nSquares = nLines * nLines;

    VclPtr<SvxTabPage> m_pPage;
    SvxTabPage* m_pPage;

    Color       aPixelColor;
    Color       aBackgroundColor;
diff --git a/include/svx/hdft.hxx b/include/svx/hdft.hxx
index a062476..1773231 100644
--- a/include/svx/hdft.hxx
+++ b/include/svx/hdft.hxx
@@ -36,9 +36,6 @@ namespace svx

class SVX_DLLPUBLIC SvxHFPage : public SfxTabPage
{
    using TabPage::ActivatePage;
    using TabPage::DeactivatePage;

public:

    virtual bool    FillItemSet( SfxItemSet* rOutSet ) override;
@@ -98,7 +95,7 @@ private:
class SVX_DLLPUBLIC SvxHeaderPage : public SvxHFPage
{
public:
    static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet );
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet );
    // returns the Which values to the range
    static const sal_uInt16*  GetRanges() { return pRanges; }
    SVX_DLLPRIVATE SvxHeaderPage(TabPageParent pParent, const SfxItemSet& rSet);
@@ -107,7 +104,7 @@ public:
class SVX_DLLPUBLIC SvxFooterPage : public SvxHFPage
{
public:
    static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet );
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet );
    static const sal_uInt16*  GetRanges() { return pRanges; }
    SVX_DLLPRIVATE SvxFooterPage(TabPageParent pParent, const SfxItemSet& rSet);
};
diff --git a/include/svx/optgrid.hxx b/include/svx/optgrid.hxx
index df86d32..5339bfd 100644
--- a/include/svx/optgrid.hxx
+++ b/include/svx/optgrid.hxx
@@ -88,14 +88,11 @@ public:

class SVX_DLLPUBLIC SvxGridTabPage : public SfxTabPage
{
    using TabPage::ActivatePage;
    using TabPage::DeactivatePage;

public:
    SvxGridTabPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual ~SvxGridTabPage() 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/include/vcl/builderpage.hxx b/include/vcl/builderpage.hxx
new file mode 100644
index 0000000..c29cc1a
--- /dev/null
+++ b/include/vcl/builderpage.hxx
@@ -0,0 +1,51 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#ifndef INCLUDED_VCL_BUILDERPAGE_HXX
#define INCLUDED_VCL_BUILDERPAGE_HXX

#include <vcl/weld.hxx>

class VCL_DLLPUBLIC BuilderPage
{
public:
    BuilderPage(weld::Widget* pParent, weld::DialogController* pController,
                const OUString& rUIXMLDescription, const OString& rID);
    virtual ~BuilderPage();

    /* The title of the page, in an Assistant the dialog may append this page title to the
       dialog title.

       While in a Dialog hosting a single Page it may use the title as
       the dialog title.
    */
    void SetPageTitle(const OUString& rPageTitle) { m_aPageTitle = rPageTitle; }
    const OUString& GetPageTitle() const { return m_aPageTitle; }

    // In a Notebook or Assistant the controller typically calls Activate on entering
    // this page, and Deactivate on leaving
    virtual void Activate();
    virtual void Deactivate();

    OString GetHelpId() const { return m_xContainer->get_help_id(); }

    weld::DialogController* GetController() const { return m_pDialogController; }

protected:
    weld::DialogController* m_pDialogController;
    std::unique_ptr<weld::Builder> m_xBuilder;
    std::unique_ptr<weld::Container> m_xContainer;

private:
    OUString m_aPageTitle;
};

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/wizardmachine.hxx b/include/vcl/wizardmachine.hxx
index 0ca764c..88788fd 100644
--- a/include/vcl/wizardmachine.hxx
+++ b/include/vcl/wizardmachine.hxx
@@ -21,8 +21,7 @@

#include <memory>
#include <vcl/dllapi.h>
#include <vcl/button.hxx>
#include <vcl/dialog.hxx>
#include <vcl/builderpage.hxx>
#include <vcl/idle.hxx>
#include <vcl/tabpage.hxx>

@@ -31,7 +30,7 @@ namespace weld {
    class Container;
}

struct ImplWizPageData;
struct WizPageData;
struct ImplWizButtonData;

// wizard states
@@ -79,11 +78,10 @@ namespace vcl
    };

    //= OWizardPage
    class VCL_DLLPUBLIC OWizardPage : public TabPage, public IWizardPageController
    class VCL_DLLPUBLIC OWizardPage : public BuilderPage, public IWizardPageController
    {
    public:
        OWizardPage(TabPageParent pParent, const OUString& rUIXMLDescription, const OString& rID);
        virtual void dispose() override;
        virtual ~OWizardPage() override;

        // IWizardPageController overridables
@@ -92,11 +90,8 @@ namespace vcl
        virtual bool        canAdvance() const override;

    protected:
        std::unique_ptr<weld::Builder> m_xBuilder;
        std::unique_ptr<weld::Container> m_xContainer;

        // TabPage overridables
        virtual void        ActivatePage() override;
        // BuilderPage overridables
        virtual void        Activate() override;

        /** updates the travel-related UI elements of the OWizardMachine we live in (if any)

@@ -126,10 +121,10 @@ namespace vcl
    class VCL_DLLPUBLIC WizardMachine : public weld::AssistantController
    {
    private:
        VclPtr<TabPage> m_xCurTabPage;
        BuilderPage* m_pCurTabPage;

        WizardTypes::WizardState m_nCurState;
        ImplWizPageData* m_pFirstPage;
        WizPageData* m_pFirstPage;

    protected:
        std::unique_ptr<weld::Button> m_xFinish;
@@ -152,10 +147,10 @@ namespace vcl
        bool ShowNextPage();
        bool ShowPrevPage();

        void                AddPage( TabPage* pPage );
        void                RemovePage( TabPage* pPage );
        void                SetPage( WizardTypes::WizardState nLevel, TabPage* pPage );
        TabPage*            GetPage( WizardTypes::WizardState eState ) const;
        void                AddPage( std::unique_ptr<BuilderPage> xPage );
        void                RemovePage( BuilderPage* pPage );
        void                SetPage( WizardTypes::WizardState nLevel, std::unique_ptr<BuilderPage> xPage );
        BuilderPage*        GetPage( WizardTypes::WizardState eState ) const;

        /// enable (or disable) buttons
        void                enableButtons(WizardButtonFlags _nWizardButtonFlags, bool _bEnable);
@@ -185,7 +180,7 @@ namespace vcl
        // our own overridables

        /// to override to create new pages
        virtual VclPtr<TabPage> createPage(WizardTypes::WizardState _nState) = 0;
        virtual std::unique_ptr<BuilderPage> createPage(WizardTypes::WizardState _nState) = 0;

        /// will be called when a new page is about to be displayed
        virtual void        enterState(WizardTypes::WizardState _nState);
@@ -303,8 +298,7 @@ namespace vcl
        */
        WizardTypes::WizardState getCurrentState() const { return m_nCurState; }

        virtual IWizardPageController*
                                getPageController( TabPage* _pCurrentPage ) const;
        virtual IWizardPageController* getPageController(BuilderPage* pCurrentPage) const;

        /** retrieves a copy of the state history, i.e. all states we already visited
        */
@@ -323,7 +317,7 @@ namespace vcl
        bool                   isTravelingSuspended() const;

    protected:
        TabPage* GetOrCreatePage(const WizardTypes::WizardState i_nState);
        BuilderPage* GetOrCreatePage(const WizardTypes::WizardState i_nState);

    private:
        DECL_DLLPRIVATE_LINK(OnNextPage, weld::Button&, void);
diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx
index ecc4835..1f9067a 100644
--- a/sc/inc/scmod.hxx
+++ b/sc/inc/scmod.hxx
@@ -234,7 +234,7 @@ public:
    // virtual methods for the options dialog
    virtual std::unique_ptr<SfxItemSet> CreateItemSet( sal_uInt16 nId ) override;
    virtual void         ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) override;
    virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet ) override;
    virtual std::unique_ptr<SfxTabPage> CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet ) override;
    virtual std::unique_ptr<SfxStyleFamilies> CreateStyleFamilies() override;

    void                SetInSharedDocLoading( bool bNew )  { m_bIsInSharedDocLoading = bNew; }
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index e21a833..77ba4c0 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -2025,9 +2025,9 @@ void ScModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
    }
}

VclPtr<SfxTabPage> ScModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet )
std::unique_ptr<SfxTabPage> ScModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet )
{
    VclPtr<SfxTabPage> pRet;
    std::unique_ptr<SfxTabPage> xRet;
    ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
    switch(nId)
    {
@@ -2035,73 +2035,73 @@ VclPtr<SfxTabPage> ScModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParen
        {
            ::CreateTabPage ScTpLayoutOptionsCreate = pFact->GetTabPageCreatorFunc(SID_SC_TP_LAYOUT);
            if (ScTpLayoutOptionsCreate)
                pRet = (*ScTpLayoutOptionsCreate)(pParent, &rSet);
                xRet = (*ScTpLayoutOptionsCreate)(pParent, &rSet);
            break;
        }
        case SID_SC_TP_CONTENT:
        {
            ::CreateTabPage ScTpContentOptionsCreate = pFact->GetTabPageCreatorFunc(SID_SC_TP_CONTENT);
            if (ScTpContentOptionsCreate)
                pRet = (*ScTpContentOptionsCreate)(pParent, &rSet);
                xRet = (*ScTpContentOptionsCreate)(pParent, &rSet);
            break;
        }
        case SID_SC_TP_GRID:
            pRet = SvxGridTabPage::Create(pParent, rSet);
            xRet = SvxGridTabPage::Create(pParent, rSet);
            break;
        case SID_SC_TP_USERLISTS:
        {
            ::CreateTabPage ScTpUserListsCreate = pFact->GetTabPageCreatorFunc(SID_SC_TP_USERLISTS);
            if (ScTpUserListsCreate)
                pRet = (*ScTpUserListsCreate)(pParent, &rSet);
                xRet = (*ScTpUserListsCreate)(pParent, &rSet);
            break;
        }
        case SID_SC_TP_CALC:
        {
            ::CreateTabPage ScTpCalcOptionsCreate = pFact->GetTabPageCreatorFunc(SID_SC_TP_CALC);
            if (ScTpCalcOptionsCreate)
                pRet = (*ScTpCalcOptionsCreate)(pParent, &rSet);
                xRet = (*ScTpCalcOptionsCreate)(pParent, &rSet);
            break;
        }
        case SID_SC_TP_FORMULA:
        {
            ::CreateTabPage ScTpFormulaOptionsCreate = pFact->GetTabPageCreatorFunc(SID_SC_TP_FORMULA);
            if (ScTpFormulaOptionsCreate)
                pRet = (*ScTpFormulaOptionsCreate)(pParent, &rSet);
                xRet = (*ScTpFormulaOptionsCreate)(pParent, &rSet);
            break;
        }
        case SID_SC_TP_COMPATIBILITY:
        {
            ::CreateTabPage ScTpCompatOptionsCreate = pFact->GetTabPageCreatorFunc(SID_SC_TP_COMPATIBILITY);
            if (ScTpCompatOptionsCreate)
                pRet = (*ScTpCompatOptionsCreate)(pParent, &rSet);
                xRet = (*ScTpCompatOptionsCreate)(pParent, &rSet);
            break;
        }
        case SID_SC_TP_CHANGES:
        {
            ::CreateTabPage ScRedlineOptionsTabPageCreate = pFact->GetTabPageCreatorFunc(SID_SC_TP_CHANGES);
            if (ScRedlineOptionsTabPageCreate)
                pRet =(*ScRedlineOptionsTabPageCreate)(pParent, &rSet);
                xRet =(*ScRedlineOptionsTabPageCreate)(pParent, &rSet);
            break;
        }
        case RID_SC_TP_PRINT:
        {
            ::CreateTabPage ScTpPrintOptionsCreate = pFact->GetTabPageCreatorFunc(RID_SC_TP_PRINT);
            if (ScTpPrintOptionsCreate)
                pRet = (*ScTpPrintOptionsCreate)(pParent, &rSet);
                xRet = (*ScTpPrintOptionsCreate)(pParent, &rSet);
            break;
        }
        case RID_SC_TP_DEFAULTS:
        {
            ::CreateTabPage ScTpDefaultsOptionsCreate = pFact->GetTabPageCreatorFunc(RID_SC_TP_DEFAULTS);
            if (ScTpDefaultsOptionsCreate)
                pRet = (*ScTpDefaultsOptionsCreate)(pParent, &rSet);
                xRet = (*ScTpDefaultsOptionsCreate)(pParent, &rSet);
            break;
        }
    }

    OSL_ENSURE( pRet, "ScModule::CreateTabPage(): no valid ID for TabPage!" );
    OSL_ENSURE( xRet, "ScModule::CreateTabPage(): no valid ID for TabPage!" );

    return pRet;
    return xRet;
}

IMPL_LINK( ScModule, CalcFieldValueHdl, EditFieldInfo*, pInfo, void )
diff --git a/sc/source/ui/attrdlg/tabpages.cxx b/sc/source/ui/attrdlg/tabpages.cxx
index 6f6fb39..68f720b 100644
--- a/sc/source/ui/attrdlg/tabpages.cxx
+++ b/sc/source/ui/attrdlg/tabpages.cxx
@@ -55,12 +55,11 @@ ScTabPageProtection::ScTabPageProtection(TabPageParent pParent, const SfxItemSet

ScTabPageProtection::~ScTabPageProtection()
{
    disposeOnce();
}

VclPtr<SfxTabPage> ScTabPageProtection::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
std::unique_ptr<SfxTabPage> ScTabPageProtection::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
{
    return VclPtr<ScTabPageProtection>::Create(pParent, *rAttrSet);
    return std::make_unique<ScTabPageProtection>(pParent, *rAttrSet);
}

void ScTabPageProtection::Reset( const SfxItemSet* rCoreAttrs )
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 1df0446..4af234b 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -100,15 +100,9 @@ ScTabPageSortFields::ScTabPageSortFields(TabPageParent pParent, const SfxItemSet

ScTabPageSortFields::~ScTabPageSortFields()
{
    disposeOnce();
}

void ScTabPageSortFields::dispose()
{
    m_aSortWin.m_aSortKeyItems.clear();
    m_xBox.reset();
    m_xScrolledWindow.reset();
    SfxTabPage::dispose();
}

void ScTabPageSortFields::Init()
@@ -129,9 +123,9 @@ void ScTabPageSortFields::Init()
    }
}

VclPtr<SfxTabPage> ScTabPageSortFields::Create(TabPageParent pParent, const SfxItemSet* pArgSet)
std::unique_ptr<SfxTabPage> ScTabPageSortFields::Create(TabPageParent pParent, const SfxItemSet* pArgSet)
{
    return VclPtr<ScTabPageSortFields>::Create(pParent, *pArgSet);
    return std::make_unique<ScTabPageSortFields>(pParent, *pArgSet);
}

void ScTabPageSortFields::Reset( const SfxItemSet* /* rArgSet */ )
@@ -580,9 +574,9 @@ void ScTabPageSortOptions::Init()
    m_xLbLanguage->InsertLanguage( LANGUAGE_SYSTEM );
}

VclPtr<SfxTabPage> ScTabPageSortOptions::Create(TabPageParent pParent, const SfxItemSet* rArgSet)
std::unique_ptr<SfxTabPage> ScTabPageSortOptions::Create(TabPageParent pParent, const SfxItemSet* rArgSet)
{
    return VclPtr<ScTabPageSortOptions>::Create(pParent, *rArgSet);
    return std::make_unique<ScTabPageSortOptions>(pParent, *rArgSet);
}

void ScTabPageSortOptions::Reset( const SfxItemSet* /* rArgSet */ )
diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx
index 260efb9..7cf70ff 100644
--- a/sc/source/ui/dbgui/tpsubt.cxx
+++ b/sc/source/ui/dbgui/tpsubt.cxx
@@ -66,7 +66,6 @@ ScTpSubTotalGroup::ScTpSubTotalGroup(TabPageParent pParent, const SfxItemSet& rA

ScTpSubTotalGroup::~ScTpSubTotalGroup()
{
    disposeOnce();
}

void ScTpSubTotalGroup::Init()
@@ -373,22 +372,22 @@ IMPL_LINK( ScTpSubTotalGroup, CheckHdl, const row_col&, rRowCol, void )

// Derived Group TabPages:

VclPtr<SfxTabPage> ScTpSubTotalGroup1::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> ScTpSubTotalGroup1::Create( TabPageParent pParent,
                                                 const SfxItemSet*  rArgSet )
{
    return VclPtr<ScTpSubTotalGroup1>::Create( pParent, *rArgSet );
    return std::make_unique<ScTpSubTotalGroup1>( pParent, *rArgSet );
}

VclPtr<SfxTabPage> ScTpSubTotalGroup2::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> ScTpSubTotalGroup2::Create( TabPageParent pParent,
                                       const SfxItemSet*    rArgSet )
{
    return VclPtr<ScTpSubTotalGroup2>::Create( pParent, *rArgSet );
    return std::make_unique<ScTpSubTotalGroup2>( pParent, *rArgSet );
}

VclPtr<SfxTabPage> ScTpSubTotalGroup3::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> ScTpSubTotalGroup3::Create( TabPageParent pParent,
                                       const SfxItemSet*    rArgSet )
{
    return VclPtr<ScTpSubTotalGroup3>::Create( pParent, *rArgSet );
    return std::make_unique<ScTpSubTotalGroup3>( pParent, *rArgSet );
}

ScTpSubTotalGroup1::ScTpSubTotalGroup1( TabPageParent pParent, const SfxItemSet& rArgSet ) :
@@ -443,7 +442,6 @@ ScTpSubTotalOptions::ScTpSubTotalOptions(TabPageParent pParent, const SfxItemSet

ScTpSubTotalOptions::~ScTpSubTotalOptions()
{
    disposeOnce();
}

void ScTpSubTotalOptions::Init()
@@ -462,10 +460,10 @@ void ScTpSubTotalOptions::Init()
    FillUserSortListBox();
}

VclPtr<SfxTabPage> ScTpSubTotalOptions::Create(TabPageParent pParent,
std::unique_ptr<SfxTabPage> ScTpSubTotalOptions::Create(TabPageParent pParent,
                                               const SfxItemSet* rArgSet)
{
    return VclPtr<ScTpSubTotalOptions>::Create(pParent, *rArgSet);
    return std::make_unique<ScTpSubTotalOptions>(pParent, *rArgSet);
}

void ScTpSubTotalOptions::Reset( const SfxItemSet* /* rArgSet */ )
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index d9f1b00..de6504b 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -377,17 +377,11 @@ ScTPValidationValue::ScTPValidationValue(TabPageParent pParent, const SfxItemSet

ScTPValidationValue::~ScTPValidationValue()
{
    disposeOnce();
}

void ScTPValidationValue::dispose()
{
    m_xEdMin.reset();
    m_xEdMin.reset();
    m_xEdMax.reset();
    m_xBtnRef.reset();
    m_xEdMax.reset();
    SfxTabPage::dispose();
}

void ScTPValidationValue::Init()
@@ -410,9 +404,9 @@ void ScTPValidationValue::Init()
    CheckHdl( *m_xCbShow );
}

VclPtr<SfxTabPage> ScTPValidationValue::Create(TabPageParent pParent, const SfxItemSet* rArgSet)
std::unique_ptr<SfxTabPage> ScTPValidationValue::Create(TabPageParent pParent, const SfxItemSet* rArgSet)
{
    return VclPtr<ScTPValidationValue>::Create(pParent, *rArgSet);
    return std::make_unique<ScTPValidationValue>(pParent, *rArgSet);
}

void ScTPValidationValue::Reset( const SfxItemSet* rArgSet )
@@ -695,13 +689,12 @@ ScTPValidationHelp::ScTPValidationHelp(TabPageParent pParent, const SfxItemSet& 

ScTPValidationHelp::~ScTPValidationHelp()
{
    disposeOnce();
}

VclPtr<SfxTabPage> ScTPValidationHelp::Create(TabPageParent pParent,
std::unique_ptr<SfxTabPage> ScTPValidationHelp::Create(TabPageParent pParent,
                                              const SfxItemSet* rArgSet)
{
    return VclPtr<ScTPValidationHelp>::Create(pParent, *rArgSet);
    return std::make_unique<ScTPValidationHelp>(pParent, *rArgSet);
}

void ScTPValidationHelp::Reset( const SfxItemSet* rArgSet )
@@ -754,7 +747,6 @@ ScTPValidationError::ScTPValidationError(TabPageParent pParent,

ScTPValidationError::~ScTPValidationError()
{
    disposeOnce();
}

void ScTPValidationError::Init()
@@ -767,10 +759,10 @@ void ScTPValidationError::Init()
    SelectActionHdl(*m_xLbAction);
}

VclPtr<SfxTabPage> ScTPValidationError::Create(TabPageParent pParent,
std::unique_ptr<SfxTabPage> ScTPValidationError::Create(TabPageParent pParent,
                                               const SfxItemSet* rArgSet)
{
    return VclPtr<ScTPValidationError>::Create(pParent, *rArgSet);
    return std::make_unique<ScTPValidationError>(pParent, *rArgSet);
}

void ScTPValidationError::Reset( const SfxItemSet* rArgSet )
diff --git a/sc/source/ui/docshell/tpstat.cxx b/sc/source/ui/docshell/tpstat.cxx
index 7e73874..615d7de 100644
--- a/sc/source/ui/docshell/tpstat.cxx
+++ b/sc/source/ui/docshell/tpstat.cxx
@@ -28,9 +28,9 @@

// Dokumentinfo-Tabpage:

VclPtr<SfxTabPage> ScDocStatPage::Create( TabPageParent pParent, const SfxItemSet* rSet )
std::unique_ptr<SfxTabPage> ScDocStatPage::Create( TabPageParent pParent, const SfxItemSet* rSet )
{
    return VclPtr<ScDocStatPage>::Create( pParent, *rSet );
    return std::make_unique<ScDocStatPage>( pParent, *rSet );
}

ScDocStatPage::ScDocStatPage(TabPageParent pParent, const SfxItemSet& rSet)
diff --git a/sc/source/ui/inc/opredlin.hxx b/sc/source/ui/inc/opredlin.hxx
index 3718187..dba8539 100644
--- a/sc/source/ui/inc/opredlin.hxx
+++ b/sc/source/ui/inc/opredlin.hxx
@@ -31,11 +31,9 @@ class ScRedlineOptionsTabPage : public SfxTabPage
    std::unique_ptr<ColorListBox> m_xMoveColorLB;

public:

    ScRedlineOptionsTabPage(TabPageParent pParent, const SfxItemSet& rSet );
    static std::unique_ptr<SfxTabPage>  Create( TabPageParent pParent, const SfxItemSet* rAttrSet );
    virtual ~ScRedlineOptionsTabPage() override;
    virtual void dispose() override;
    static VclPtr<SfxTabPage>  Create( TabPageParent pParent, const SfxItemSet* rAttrSet );

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx
index 5511d7c..8c2660e 100644
--- a/sc/source/ui/inc/prevwsh.hxx
+++ b/sc/source/ui/inc/prevwsh.hxx
@@ -104,7 +104,7 @@ public:
    virtual SfxPrinter*     GetPrinter( bool bCreate = false ) override;
    virtual sal_uInt16      SetPrinter( SfxPrinter* pNewPrinter, SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL ) override;
    virtual bool            HasPrintOptionsPage() const override;
    virtual VclPtr<SfxTabPage> CreatePrintOptionsPage(TabPageParent pParent, const SfxItemSet &rOptions) override;
    virtual std::unique_ptr<SfxTabPage> CreatePrintOptionsPage(TabPageParent pParent, const SfxItemSet &rOptions) override;

    void            AddAccessibilityObject( SfxListener& rObject );
    void            RemoveAccessibilityObject( SfxListener& rObject );
diff --git a/sc/source/ui/inc/scuitphfedit.hxx b/sc/source/ui/inc/scuitphfedit.hxx
index d377a12..0f114fa 100644
--- a/sc/source/ui/inc/scuitphfedit.hxx
+++ b/sc/source/ui/inc/scuitphfedit.hxx
@@ -115,41 +115,29 @@ private:

class ScRightHeaderEditPage : public ScHFEditPage
{
    friend class VclPtr<ScRightHeaderEditPage>;
public:
    static VclPtr<SfxTabPage>  Create( TabPageParent pParent, const SfxItemSet* rCoreSet );

private:
    static std::unique_ptr<SfxTabPage>  Create( TabPageParent pParent, const SfxItemSet* rCoreSet );
    ScRightHeaderEditPage( TabPageParent pParent, const SfxItemSet& rSet );
};

class ScLeftHeaderEditPage : public ScHFEditPage
{
    friend class VclPtr<ScLeftHeaderEditPage>;
public:
    static VclPtr<SfxTabPage>  Create( TabPageParent pParent, const SfxItemSet* rCoreSet );

private:
    static std::unique_ptr<SfxTabPage>  Create( TabPageParent pParent, const SfxItemSet* rCoreSet );
    ScLeftHeaderEditPage( TabPageParent pParent, const SfxItemSet& rSet );
};

class ScRightFooterEditPage : public ScHFEditPage
{
    friend class VclPtr<ScRightFooterEditPage>;
public:
    static VclPtr<SfxTabPage>  Create( TabPageParent pParent, const SfxItemSet* rCoreSet );

private:
    static std::unique_ptr<SfxTabPage>  Create( TabPageParent pParent, const SfxItemSet* rCoreSet );
    ScRightFooterEditPage( TabPageParent pParent, const SfxItemSet& rSet );
};

class ScLeftFooterEditPage : public ScHFEditPage
{
    friend class VclPtr<ScLeftFooterEditPage>;
public:
    static VclPtr<SfxTabPage>  Create( TabPageParent pParent, const SfxItemSet* rCoreSet );

private:
    static std::unique_ptr<SfxTabPage>  Create( TabPageParent pParent, const SfxItemSet* rCoreSet );
    ScLeftFooterEditPage( TabPageParent pParent, const SfxItemSet& rSet );
};

diff --git a/sc/source/ui/inc/tabpages.hxx b/sc/source/ui/inc/tabpages.hxx
index 16046ab..9cdffb2 100644
--- a/sc/source/ui/inc/tabpages.hxx
+++ b/sc/source/ui/inc/tabpages.hxx
@@ -24,24 +24,21 @@

class ScTabPageProtection : public SfxTabPage
{
    friend class VclPtr<ScTabPageProtection>;
    static const sal_uInt16 pProtectionRanges[];
public:
    static  VclPtr<SfxTabPage> Create          ( TabPageParent               pParent,
                                          const SfxItemSet*     rAttrSet );
    ScTabPageProtection(TabPageParent pParent, const SfxItemSet& rCoreAttrs);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent,
                                              const SfxItemSet* rAttrSet);
    virtual ~ScTabPageProtection() override;

    static  const sal_uInt16* GetRanges () { return pProtectionRanges; }
    virtual bool        FillItemSet     ( SfxItemSet* rCoreAttrs ) override;
    virtual void        Reset           ( const SfxItemSet* ) override;

    virtual ~ScTabPageProtection() override;

protected:
    using SfxTabPage::DeactivatePage;
    virtual DeactivateRC   DeactivatePage  ( SfxItemSet* pSet ) override;

private:
    ScTabPageProtection(TabPageParent pParent, const SfxItemSet& rCoreAttrs);
private:
                                        // current status:
    bool            bTriEnabled;        //  if before - DontCare
    bool            bDontCare;          //  all in  TriState
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 50b9a09..3b6005a 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -319,7 +319,7 @@ public:
                                          SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL ) override;

    virtual bool            HasPrintOptionsPage() const override;
    virtual VclPtr<SfxTabPage> CreatePrintOptionsPage(TabPageParent pParent, const SfxItemSet &rOptions) override;
    virtual std::unique_ptr<SfxTabPage> CreatePrintOptionsPage(TabPageParent pParent, const SfxItemSet &rOptions) override;

    void            ConnectObject( const SdrOle2Obj* pObj );
    void            ActivateObject( SdrOle2Obj* pObj, long nVerb );
diff --git a/sc/source/ui/inc/tpcalc.hxx b/sc/source/ui/inc/tpcalc.hxx
index 6c87838..d32704f 100644
--- a/sc/source/ui/inc/tpcalc.hxx
+++ b/sc/source/ui/inc/tpcalc.hxx
@@ -27,20 +27,15 @@ class ScDocOptions;

class ScTpCalcOptions : public SfxTabPage
{
    friend class VclPtr<ScTpCalcOptions>;
public:
    static  VclPtr<SfxTabPage> Create          ( TabPageParent pParent,
                                          const SfxItemSet*     rCoreSet );
    ScTpCalcOptions(TabPageParent pParent, const SfxItemSet&  rCoreSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rCoreSet);
    virtual ~ScTpCalcOptions() override;
    virtual bool        FillItemSet     ( SfxItemSet* rCoreSet ) override;
    virtual void        Reset           ( const SfxItemSet* rCoreSet ) override;
    using SfxTabPage::DeactivatePage;
    virtual DeactivateRC   DeactivatePage  ( SfxItemSet* pSet ) override;

private:
    ScTpCalcOptions(TabPageParent pParent, const SfxItemSet&  rCoreSet);
    virtual ~ScTpCalcOptions() override;

private:
    std::unique_ptr<ScDocOptions> pOldOptions;
    std::unique_ptr<ScDocOptions> pLocalOptions;
    sal_uInt16 const             nWhichCalc;
diff --git a/sc/source/ui/inc/tpcompatibility.hxx b/sc/source/ui/inc/tpcompatibility.hxx
index 7d895a6..4bceec9 100644
--- a/sc/source/ui/inc/tpcompatibility.hxx
+++ b/sc/source/ui/inc/tpcompatibility.hxx
@@ -14,19 +14,15 @@

class ScTpCompatOptions : public SfxTabPage
{
    friend class VclPtr<ScTpCompatOptions>;
public:
    using SfxTabPage::DeactivatePage;

    static  VclPtr<SfxTabPage> Create (TabPageParent pParent, const SfxItemSet* rCoreAttrs);
    explicit ScTpCompatOptions(TabPageParent pParent, const SfxItemSet& rCoreAttrs);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rCoreAttrs);
    virtual ~ScTpCompatOptions() override;

    virtual bool FillItemSet(SfxItemSet* rCoreAttrs) override;
    virtual void Reset(const SfxItemSet* rCoreAttrs) override;
    virtual DeactivateRC DeactivatePage(SfxItemSet* pSet ) override;

    virtual ~ScTpCompatOptions() override;
private:
    explicit ScTpCompatOptions(TabPageParent pParent, const SfxItemSet& rCoreAttrs);
private:
    std::unique_ptr<weld::ComboBox> m_xLbKeyBindings;
};
diff --git a/sc/source/ui/inc/tpdefaults.hxx b/sc/source/ui/inc/tpdefaults.hxx
index 59be1c7..a2a88e7 100644
--- a/sc/source/ui/inc/tpdefaults.hxx
+++ b/sc/source/ui/inc/tpdefaults.hxx
@@ -15,20 +15,16 @@

class ScTpDefaultsOptions : public SfxTabPage
{
    friend class VclPtr<ScTpDefaultsOptions>;
public:
    using SfxTabPage::DeactivatePage;

    static  VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rCoreSet);
    explicit ScTpDefaultsOptions(TabPageParent pParent, const SfxItemSet& rCoreSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rCoreSet);
    virtual ~ScTpDefaultsOptions() override;

    virtual bool FillItemSet(SfxItemSet* rCoreSet) override;
    virtual void Reset(const SfxItemSet* rCoreSet) override;
    virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override;

private:
    explicit ScTpDefaultsOptions(TabPageParent pParent, const SfxItemSet& rCoreSet);
    virtual ~ScTpDefaultsOptions() override;

    void CheckNumSheets();
    void CheckPrefix();
    void OnFocusPrefixInput();
diff --git a/sc/source/ui/inc/tpformula.hxx b/sc/source/ui/inc/tpformula.hxx
index dd7ec5c..2aee580 100644
--- a/sc/source/ui/inc/tpformula.hxx
+++ b/sc/source/ui/inc/tpformula.hxx
@@ -27,19 +27,16 @@

class ScTpFormulaOptions : public SfxTabPage
{
    friend class VclPtr<ScTpFormulaOptions>;
public:
    using SfxTabPage::DeactivatePage;

    static  VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rCoreSet);
    explicit ScTpFormulaOptions(TabPageParent pParent, const SfxItemSet& rCoreSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rCoreSet);
    virtual ~ScTpFormulaOptions() override;

    virtual bool FillItemSet(SfxItemSet* rCoreSet) override;
    virtual void Reset( const SfxItemSet* rCoreSet ) override;
    virtual DeactivateRC DeactivatePage(SfxItemSet* pSet ) override;

private:
    explicit ScTpFormulaOptions(TabPageParent pParent, const SfxItemSet& rCoreSet);
    virtual ~ScTpFormulaOptions() override;
    void ResetSeparators();
    void OnFocusSeparatorInput(weld::Entry* pEdit);
    void UpdateCustomCalcRadioButtons(bool bDefault);
diff --git a/sc/source/ui/inc/tphf.hxx b/sc/source/ui/inc/tphf.hxx
index 94a8b28..17d7c2a 100644
--- a/sc/source/ui/inc/tphf.hxx
+++ b/sc/source/ui/inc/tphf.hxx
@@ -28,7 +28,6 @@ class ScHFPage : public SvxHFPage
{
public:
    virtual         ~ScHFPage() override;
    virtual void    dispose() override;

    virtual void    Reset( const SfxItemSet* rSet ) override;
    virtual bool    FillItemSet( SfxItemSet* rOutSet ) override;
@@ -39,8 +38,6 @@ public:
protected:
    ScHFPage(TabPageParent pParent, const SfxItemSet& rSet, sal_uInt16 nSetId);

    virtual void    ActivatePage() override;
    virtual void    DeactivatePage() override;
    virtual void    ActivatePage( const SfxItemSet& rSet ) override;
    virtual DeactivateRC   DeactivatePage( SfxItemSet* pSet ) override;

@@ -58,24 +55,18 @@ private:

class ScHeaderPage : public ScHFPage
{
    friend class VclPtr<ScHeaderPage>;
public:
    static VclPtr<SfxTabPage>  Create( TabPageParent pParent, const SfxItemSet* rSet );
    static const sal_uInt16*      GetRanges();

private:
    static std::unique_ptr<SfxTabPage>  Create( TabPageParent pParent, const SfxItemSet* rSet );
    ScHeaderPage(TabPageParent pParent, const SfxItemSet& rSet);
    static const sal_uInt16*      GetRanges();
};

class ScFooterPage : public ScHFPage
{
    friend class VclPtr<ScFooterPage>;
public:
    static VclPtr<SfxTabPage>  Create( TabPageParent pParent, const SfxItemSet* rSet );
    static const sal_uInt16*      GetRanges();

private:
    static std::unique_ptr<SfxTabPage>  Create( TabPageParent pParent, const SfxItemSet* rSet );
    ScFooterPage(TabPageParent pParent, const SfxItemSet& rSet);
    static const sal_uInt16*      GetRanges();
};

#endif // INCLUDED_SC_SOURCE_UI_INC_TPHF_HXX
diff --git a/sc/source/ui/inc/tpprint.hxx b/sc/source/ui/inc/tpprint.hxx
index 9ddae6e..ef15a39 100644
--- a/sc/source/ui/inc/tpprint.hxx
+++ b/sc/source/ui/inc/tpprint.hxx
@@ -24,18 +24,17 @@

class ScTpPrintOptions : public SfxTabPage
{
    friend class VclPtr<ScTpPrintOptions>;
    std::unique_ptr<weld::CheckButton>       m_xSkipEmptyPagesCB;
    std::unique_ptr<weld::CheckButton>       m_xSelectedSheetsCB;
    std::unique_ptr<weld::CheckButton>       m_xForceBreaksCB;

    ScTpPrintOptions(TabPageParent pPage, const SfxItemSet& rCoreSet);
public:
    ScTpPrintOptions(TabPageParent pPage, const SfxItemSet& rCoreSet);
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rCoreSet );
    virtual ~ScTpPrintOptions() override;
    static VclPtr<SfxTabPage>  Create( TabPageParent pParent, const SfxItemSet* rCoreSet );

    virtual bool        FillItemSet( SfxItemSet* rCoreSet ) override;
    virtual void        Reset( const SfxItemSet* rCoreSet ) override;
    using SfxTabPage::DeactivatePage;
    virtual DeactivateRC   DeactivatePage( SfxItemSet* pSet ) override;
};

diff --git a/sc/source/ui/inc/tpsort.hxx b/sc/source/ui/inc/tpsort.hxx
index 755b9f8..655ff11 100644
--- a/sc/source/ui/inc/tpsort.hxx
+++ b/sc/source/ui/inc/tpsort.hxx
@@ -43,17 +43,14 @@ class ScTabPageSortFields : public SfxTabPage
{
public:
    ScTabPageSortFields(TabPageParent pParent, const SfxItemSet& rArgSet);
    virtual void dispose() override;
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rArgSet);
    virtual ~ScTabPageSortFields() override;
    static  VclPtr<SfxTabPage> Create      ( TabPageParent               pParent,
                                      const SfxItemSet*     rArgSet );

    virtual bool        FillItemSet ( SfxItemSet* rArgSet ) override;
    virtual void        Reset       ( const SfxItemSet* rArgSet ) override;

protected:
    virtual void        ActivatePage    ( const SfxItemSet& rSet ) override;
    using SfxTabPage::ActivatePage;
    using SfxTabPage::DeactivatePage;
    virtual DeactivateRC   DeactivatePage  ( SfxItemSet* pSet ) override;

private:
@@ -98,15 +95,13 @@ class ScTabPageSortOptions : public SfxTabPage
{
public:
    ScTabPageSortOptions(TabPageParent pParent, const SfxItemSet& rArgSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* pArgSet);

    static  VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* pArgSet);
    virtual bool        FillItemSet ( SfxItemSet* rArgSet ) override;
    virtual void        Reset       ( const SfxItemSet* rArgSet ) override;

protected:
    virtual void        ActivatePage    ( const SfxItemSet& rSet ) override;
    using SfxTabPage::ActivatePage;
    using SfxTabPage::DeactivatePage;
    virtual DeactivateRC   DeactivatePage  ( SfxItemSet* pSet ) override;

private:
diff --git a/sc/source/ui/inc/tpstat.hxx b/sc/source/ui/inc/tpstat.hxx
index a24bc18..a317345 100644
--- a/sc/source/ui/inc/tpstat.hxx
+++ b/sc/source/ui/inc/tpstat.hxx
@@ -24,13 +24,11 @@

class ScDocStatPage: public SfxTabPage
{
    friend class VclPtr<ScDocStatPage>;
public:
    static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet );
    virtual         ~ScDocStatPage() override;

private:
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet);
    ScDocStatPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual ~ScDocStatPage() override;

protected:
    virtual bool    FillItemSet( SfxItemSet* rSet ) override;
    virtual void    Reset      ( const SfxItemSet* rSet ) override;
diff --git a/sc/source/ui/inc/tpsubt.hxx b/sc/source/ui/inc/tpsubt.hxx
index 8051074..4f3c48e 100644
--- a/sc/source/ui/inc/tpsubt.hxx
+++ b/sc/source/ui/inc/tpsubt.hxx
@@ -75,45 +75,39 @@ private:

class ScTpSubTotalGroup1 final : public ScTpSubTotalGroup
{
    friend class VclPtr<ScTpSubTotalGroup1>;
public:
    ScTpSubTotalGroup1( TabPageParent pParent,
                        const SfxItemSet&    rArgSet );

public:
    static std::unique_ptr<SfxTabPage> Create      ( TabPageParent pParent,
            const SfxItemSet*     rArgSet );
    virtual ~ScTpSubTotalGroup1() override;

    static  VclPtr<SfxTabPage> Create      ( TabPageParent pParent,
            const SfxItemSet*     rArgSet );
    virtual bool        FillItemSet ( SfxItemSet* rArgSet ) override;
    virtual void        Reset       ( const SfxItemSet* rArgSet ) override;
};

class ScTpSubTotalGroup2 final : public ScTpSubTotalGroup
{
    friend class VclPtr<ScTpSubTotalGroup2>;
public:
    ScTpSubTotalGroup2( TabPageParent pParent,
                        const SfxItemSet&    rArgSet );

public:
    static std::unique_ptr<SfxTabPage> Create      ( TabPageParent pParent,
            const SfxItemSet*     rArgSet );
    virtual ~ScTpSubTotalGroup2() override;

    static  VclPtr<SfxTabPage> Create      ( TabPageParent pParent,
            const SfxItemSet*     rArgSet );
    virtual bool        FillItemSet ( SfxItemSet* rArgSet ) override;
    virtual void        Reset       ( const SfxItemSet* rArgSet ) override;
};

class ScTpSubTotalGroup3 final : public ScTpSubTotalGroup
{
    friend class VclPtr<ScTpSubTotalGroup3>;
public:
    ScTpSubTotalGroup3( TabPageParent pParent,
                        const SfxItemSet&    rArgSet );

public:
    static  std::unique_ptr<SfxTabPage> Create      ( TabPageParent pParent,
            const SfxItemSet*     rArgSet );
    virtual ~ScTpSubTotalGroup3() override;

    static  VclPtr<SfxTabPage> Create      ( TabPageParent pParent,
            const SfxItemSet*     rArgSet );
    virtual bool        FillItemSet ( SfxItemSet* rArgSet ) override;
    virtual void        Reset       ( const SfxItemSet* rArgSet ) override;
};
@@ -121,16 +115,15 @@ public:
class ScTpSubTotalOptions final : public SfxTabPage
{
public:
    virtual ~ScTpSubTotalOptions() override;
    static VclPtr<SfxTabPage>  Create      ( TabPageParent pParent,
    ScTpSubTotalOptions(TabPageParent pParent, const SfxItemSet& rArgSet);
    static std::unique_ptr<SfxTabPage>  Create      ( TabPageParent pParent,
            const SfxItemSet*     rArgSet );
    virtual ~ScTpSubTotalOptions() override;

    virtual bool        FillItemSet ( SfxItemSet* rArgSet ) override;
    virtual void        Reset       ( const SfxItemSet* rArgSet ) override;

private:
    friend class VclPtr<ScTpSubTotalOptions>;
    ScTpSubTotalOptions(TabPageParent pParent, const SfxItemSet& rArgSet);

    void Init                   ();
    void FillUserSortListBox    ();

diff --git a/sc/source/ui/inc/tptable.hxx b/sc/source/ui/inc/tptable.hxx
index 52b2a36..fe517c3 100644
--- a/sc/source/ui/inc/tptable.hxx
+++ b/sc/source/ui/inc/tptable.hxx
@@ -24,21 +24,18 @@

class ScTablePage : public SfxTabPage
{
    friend class VclPtr<ScTablePage>;
    static const sal_uInt16 pPageTableRanges[];
public:
    static  VclPtr<SfxTabPage> Create          ( TabPageParent pParent,
                                          const SfxItemSet* rCoreSet );
    ScTablePage(TabPageParent pParent, const SfxItemSet& rCoreSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rCoreSet);
    virtual         ~ScTablePage() override;

    static  const sal_uInt16* GetRanges () { return pPageTableRanges; }
    virtual bool        FillItemSet     ( SfxItemSet* rCoreSet ) override;
    virtual void        Reset           ( const SfxItemSet* rCoreSet ) override;
    using SfxTabPage::DeactivatePage;
    virtual DeactivateRC   DeactivatePage  ( SfxItemSet* pSet ) override;
    virtual void        DataChanged     ( const DataChangedEvent& rDCEvt ) override;

    virtual         ~ScTablePage() override;
private:
    ScTablePage(TabPageParent pParent, const SfxItemSet& rCoreSet);
    void            ShowImage();

private:
diff --git a/sc/source/ui/inc/tpusrlst.hxx b/sc/source/ui/inc/tpusrlst.hxx
index 01af1e5..438d8975 100644
--- a/sc/source/ui/inc/tpusrlst.hxx
+++ b/sc/source/ui/inc/tpusrlst.hxx
@@ -32,20 +32,16 @@ class ScRefAddress;

class ScTpUserLists : public SfxTabPage
{
    friend class VclPtr<ScTpUserLists>;
public:
    static  VclPtr<SfxTabPage> Create          ( TabPageParent pParent,
                                          const SfxItemSet*     rAttrSet );
    ScTpUserLists(TabPageParent pParent, const SfxItemSet& rArgSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent,
                                          const SfxItemSet* rAttrSet);
    virtual ~ScTpUserLists() override;
    virtual bool        FillItemSet     ( SfxItemSet* rCoreAttrs ) override;
    virtual void        Reset           ( const SfxItemSet* rCoreAttrs ) override;
    using SfxTabPage::DeactivatePage;
    virtual DeactivateRC   DeactivatePage  ( SfxItemSet* pSet ) override;

private:
    ScTpUserLists(TabPageParent pParent, const SfxItemSet& rArgSet);
    virtual ~ScTpUserLists() override;

private:
    std::unique_ptr<weld::Label> mxFtLists;
    std::unique_ptr<weld::TreeView> mxLbLists;
    std::unique_ptr<weld::Label> mxFtEntries;
diff --git a/sc/source/ui/inc/tpview.hxx b/sc/source/ui/inc/tpview.hxx
index f9f992e..3e47c2d 100644
--- a/sc/source/ui/inc/tpview.hxx
+++ b/sc/source/ui/inc/tpview.hxx
@@ -27,7 +27,6 @@ class ScViewOptions;

class ScTpContentOptions : public SfxTabPage
{
    friend class VclPtr<ScTpContentOptions>;
    std::unique_ptr<ScViewOptions> m_xLocalOptions;

    std::unique_ptr<weld::ComboBox> m_xGridLB;
@@ -62,17 +61,12 @@ class ScTpContentOptions : public SfxTabPage
    DECL_LINK( SelLbObjHdl, weld::ComboBox&, void );
    DECL_LINK( CBHdl, weld::ToggleButton&, void );

    ScTpContentOptions(TabPageParent pParent, const SfxItemSet& rArgSet);
    virtual void dispose() override;
    virtual ~ScTpContentOptions() override;

public:
    static  VclPtr<SfxTabPage> Create          ( TabPageParent pParent,
                                          const SfxItemSet*     rCoreSet );
    ScTpContentOptions(TabPageParent pParent, const SfxItemSet& rArgSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rCoreSet);
    virtual ~ScTpContentOptions() override;
    virtual bool        FillItemSet     ( SfxItemSet* rCoreSet ) override;
    virtual void        Reset           ( const SfxItemSet* rCoreSet ) override;
    using SfxTabPage::ActivatePage;
    using SfxTabPage::DeactivatePage;
    virtual void        ActivatePage( const SfxItemSet& ) override;
    virtual DeactivateRC   DeactivatePage( SfxItemSet* pSet ) override;

@@ -81,7 +75,6 @@ public:
class ScDocument;
class ScTpLayoutOptions : public SfxTabPage
{
    friend class VclPtrInstance<ScTpLayoutOptions>;
    ScDocument *pDoc;

    std::unique_ptr<weld::ComboBox> m_xUnitLB;
@@ -106,15 +99,13 @@ class ScTpLayoutOptions : public SfxTabPage
    DECL_LINK( AlignHdl, weld::ToggleButton&, void );


    ScTpLayoutOptions(TabPageParent pParent, const SfxItemSet&  rArgSet );
public:
    ScTpLayoutOptions(TabPageParent pParent, const SfxItemSet&  rArgSet );
    static  std::unique_ptr<SfxTabPage> Create(TabPageParent pParent,
                                          const SfxItemSet* rCoreSet);
    virtual ~ScTpLayoutOptions() override;
    static  VclPtr<SfxTabPage> Create          ( TabPageParent pParent,
                                          const SfxItemSet*     rCoreSet );
    virtual bool        FillItemSet     ( SfxItemSet* rCoreSet ) override;
    virtual void        Reset           ( const SfxItemSet* rCoreSet ) override;
    using SfxTabPage::ActivatePage;
    using SfxTabPage::DeactivatePage;
    virtual void        ActivatePage( const SfxItemSet& ) override;
    virtual DeactivateRC   DeactivatePage( SfxItemSet* pSet ) override;
};
diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx
index 33596c5..d5f3383 100644
--- a/sc/source/ui/inc/validate.hxx
+++ b/sc/source/ui/inc/validate.hxx
@@ -25,12 +25,14 @@
#include "anyrefdg.hxx"
#include <sc.hrc>

struct ScRefHandlerCaller : public virtual VclReferenceBase {
struct  ScRefHandlerCaller{
    virtual ~ScRefHandlerCaller(){}
};

class ScRefHandlerHelper
{
protected:
    VclPtr<ScRefHandlerCaller>  m_pHandler;
    ScRefHandlerCaller*  m_pHandler;
// workaround VS2013 issue with pointers to things that contain virtual base class
#ifdef _WIN32
    #pragma pack(push, 16)
@@ -76,9 +78,9 @@ class ScTPValidationValue : public ScRefHandlerCaller, public SfxTabPage
    static const sal_uInt16 pValueRanges[];
public:
    explicit                    ScTPValidationValue(TabPageParent pParent, const SfxItemSet& rArgSet);
    virtual void                dispose() override;
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rArgSet );
    virtual                     ~ScTPValidationValue() override;
    static VclPtr<SfxTabPage>   Create( TabPageParent pParent, const SfxItemSet* rArgSet );

    static const sal_uInt16*    GetRanges() { return pValueRanges; }

    virtual bool                FillItemSet( SfxItemSet* rArgSet ) override;
@@ -236,9 +238,9 @@ private:

public:
    ScTPValidationHelp(TabPageParent pParent, const SfxItemSet& rArgSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rArgSet);
    virtual ~ScTPValidationHelp() override;

    static  VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rArgSet);
    virtual bool        FillItemSet ( SfxItemSet* rArgSet ) override;
    virtual void        Reset       ( const SfxItemSet* rArgSet ) override;
};
@@ -261,9 +263,9 @@ private:

public:
    ScTPValidationError(TabPageParent pParent, const SfxItemSet& rArgSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rArgSet);
    virtual ~ScTPValidationError() override;

    static  VclPtr<SfxTabPage> Create      ( TabPageParent pParent, const SfxItemSet* rArgSet );
    virtual bool        FillItemSet ( SfxItemSet* rArgSet ) override;
    virtual void        Reset       ( const SfxItemSet* rArgSet ) override;
};
diff --git a/sc/source/ui/optdlg/opredlin.cxx b/sc/source/ui/optdlg/opredlin.cxx
index b442462..c3a4d3f 100644
--- a/sc/source/ui/optdlg/opredlin.cxx
+++ b/sc/source/ui/optdlg/opredlin.cxx
@@ -43,21 +43,15 @@ ScRedlineOptionsTabPage::ScRedlineOptionsTabPage(TabPageParent pParent, const Sf

ScRedlineOptionsTabPage::~ScRedlineOptionsTabPage()
{
    disposeOnce();
}

void ScRedlineOptionsTabPage::dispose()
{
    m_xContentColorLB.reset();
    m_xRemoveColorLB.reset();
    m_xInsertColorLB.reset();
    m_xMoveColorLB.reset();
    SfxTabPage::dispose();
}

VclPtr<SfxTabPage> ScRedlineOptionsTabPage::Create( TabPageParent pParent, const SfxItemSet* rSet )
std::unique_ptr<SfxTabPage> ScRedlineOptionsTabPage::Create( TabPageParent pParent, const SfxItemSet* rSet )
{
    return VclPtr<ScRedlineOptionsTabPage>::Create( pParent, *rSet );
    return std::make_unique<ScRedlineOptionsTabPage>( pParent, *rSet );
}

bool ScRedlineOptionsTabPage::FillItemSet( SfxItemSet* /* rSet */ )
diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx
index 12833f3..5ea4b40 100644
--- a/sc/source/ui/optdlg/tpcalc.cxx
+++ b/sc/source/ui/optdlg/tpcalc.cxx
@@ -77,9 +77,9 @@ void ScTpCalcOptions::Init()
    m_xBtnThread->connect_toggled( LINK( this, ScTpCalcOptions, CheckClickHdl ) );
}

VclPtr<SfxTabPage> ScTpCalcOptions::Create( TabPageParent pParent, const SfxItemSet* rAttrSet )
std::unique_ptr<SfxTabPage> ScTpCalcOptions::Create( TabPageParent pParent, const SfxItemSet* rAttrSet )
{
    return VclPtr<ScTpCalcOptions>::Create( pParent, *rAttrSet );
    return std::make_unique<ScTpCalcOptions>( pParent, *rAttrSet );
}

void ScTpCalcOptions::Reset( const SfxItemSet* /* rCoreAttrs */ )
diff --git a/sc/source/ui/optdlg/tpcompatibility.cxx b/sc/source/ui/optdlg/tpcompatibility.cxx
index a7b2dd1..17493b6 100644
--- a/sc/source/ui/optdlg/tpcompatibility.cxx
+++ b/sc/source/ui/optdlg/tpcompatibility.cxx
@@ -25,9 +25,9 @@ ScTpCompatOptions::~ScTpCompatOptions()
{
}

VclPtr<SfxTabPage> ScTpCompatOptions::Create(TabPageParent pParent, const SfxItemSet *rCoreAttrs)
std::unique_ptr<SfxTabPage> ScTpCompatOptions::Create(TabPageParent pParent, const SfxItemSet *rCoreAttrs)
{
    return VclPtr<ScTpCompatOptions>::Create(pParent, *rCoreAttrs);
    return std::make_unique<ScTpCompatOptions>(pParent, *rCoreAttrs);
}

bool ScTpCompatOptions::FillItemSet(SfxItemSet *rCoreAttrs)
diff --git a/sc/source/ui/optdlg/tpdefaults.cxx b/sc/source/ui/optdlg/tpdefaults.cxx
index 9fd4e91..4560532 100644
--- a/sc/source/ui/optdlg/tpdefaults.cxx
+++ b/sc/source/ui/optdlg/tpdefaults.cxx
@@ -28,9 +28,9 @@ ScTpDefaultsOptions::~ScTpDefaultsOptions()
{
}

VclPtr<SfxTabPage> ScTpDefaultsOptions::Create(TabPageParent pParent, const SfxItemSet *rCoreAttrs)
std::unique_ptr<SfxTabPage> ScTpDefaultsOptions::Create(TabPageParent pParent, const SfxItemSet *rCoreAttrs)
{
    return VclPtr<ScTpDefaultsOptions>::Create(pParent, *rCoreAttrs);
    return std::make_unique<ScTpDefaultsOptions>(pParent, *rCoreAttrs);
}

bool ScTpDefaultsOptions::FillItemSet(SfxItemSet *rCoreSet)
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index 97ea253..2edc691 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -203,9 +203,9 @@ IMPL_LINK( ScTpFormulaOptions, SepEditOnFocusHdl, weld::Widget&, rControl, void 
    OnFocusSeparatorInput(dynamic_cast<weld::Entry*>(&rControl));
}

VclPtr<SfxTabPage> ScTpFormulaOptions::Create(TabPageParent pParent, const SfxItemSet* rCoreSet)
std::unique_ptr<SfxTabPage> ScTpFormulaOptions::Create(TabPageParent pParent, const SfxItemSet* rCoreSet)
{
    return VclPtr<ScTpFormulaOptions>::Create(pParent, *rCoreSet);
    return std::make_unique<ScTpFormulaOptions>(pParent, *rCoreSet);
}

bool ScTpFormulaOptions::FillItemSet(SfxItemSet* rCoreSet)
diff --git a/sc/source/ui/optdlg/tpprint.cxx b/sc/source/ui/optdlg/tpprint.cxx
index f38a2f5..b3c5ee1 100644
--- a/sc/source/ui/optdlg/tpprint.cxx
+++ b/sc/source/ui/optdlg/tpprint.cxx
@@ -39,9 +39,9 @@ ScTpPrintOptions::~ScTpPrintOptions()
{
}

VclPtr<SfxTabPage> ScTpPrintOptions::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
std::unique_ptr<SfxTabPage> ScTpPrintOptions::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
{
    return VclPtr<ScTpPrintOptions>::Create(pParent, *rAttrSet);
    return std::make_unique<ScTpPrintOptions>(pParent, *rAttrSet);
}

DeactivateRC ScTpPrintOptions::DeactivatePage( SfxItemSet* pSetP )
diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx
index 9d0f8f7..3d71209 100644
--- a/sc/source/ui/optdlg/tpusrlst.cxx
+++ b/sc/source/ui/optdlg/tpusrlst.cxx
@@ -128,9 +128,9 @@ void ScTpUserLists::Init()

}

VclPtr<SfxTabPage> ScTpUserLists::Create( TabPageParent pParent, const SfxItemSet* rAttrSet )
std::unique_ptr<SfxTabPage> ScTpUserLists::Create( TabPageParent pParent, const SfxItemSet* rAttrSet )
{
    return VclPtr<ScTpUserLists>::Create(pParent, *rAttrSet);
    return std::make_unique<ScTpUserLists>(pParent, *rAttrSet);
}

void ScTpUserLists::Reset( const SfxItemSet* rCoreAttrs )
diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx
index c26ff3b..0fff707 100644
--- a/sc/source/ui/optdlg/tpview.cxx
+++ b/sc/source/ui/optdlg/tpview.cxx
@@ -87,19 +87,13 @@ ScTpContentOptions::ScTpContentOptions(TabPageParent pParent, const SfxItemSet& 

ScTpContentOptions::~ScTpContentOptions()
{
    disposeOnce();
}

void ScTpContentOptions::dispose()
{
    m_xColorLB.reset();
    SfxTabPage::dispose();
}

VclPtr<SfxTabPage> ScTpContentOptions::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> ScTpContentOptions::Create( TabPageParent pParent,
                                               const SfxItemSet*     rCoreSet )
{
    return VclPtr<ScTpContentOptions>::Create(pParent, *rCoreSet);
    return std::make_unique<ScTpContentOptions>(pParent, *rCoreSet);
}

bool    ScTpContentOptions::FillItemSet( SfxItemSet* rCoreSet )
@@ -359,15 +353,15 @@ ScTpLayoutOptions::~ScTpLayoutOptions()
{
}

VclPtr<SfxTabPage> ScTpLayoutOptions::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> ScTpLayoutOptions::Create( TabPageParent pParent,
                                              const SfxItemSet*   rCoreSet )
{
    VclPtrInstance<ScTpLayoutOptions> pNew( pParent, *rCoreSet );
    ScDocShell* pDocSh = dynamic_cast< ScDocShell *>( SfxObjectShell::Current() );
    auto xNew = std::make_unique<ScTpLayoutOptions>(pParent, *rCoreSet);

    if(pDocSh!=nullptr)
        pNew->pDoc = &pDocSh->GetDocument();
    return pNew;
    ScDocShell* pDocSh = dynamic_cast< ScDocShell *>( SfxObjectShell::Current() );
    if (pDocSh!=nullptr)
        xNew->pDoc = &pDocSh->GetDocument();
    return xNew;
}

bool    ScTpLayoutOptions::FillItemSet( SfxItemSet* rCoreSet )
diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx
index 033faeb0..4a1d559 100644
--- a/sc/source/ui/pagedlg/scuitphfedit.cxx
+++ b/sc/source/ui/pagedlg/scuitphfedit.cxx
@@ -137,7 +137,6 @@ IMPL_LINK_NOARG( ScHFEditPage, ObjectSelectHdl, ScEditWindow&, void )

ScHFEditPage::~ScHFEditPage()
{
    disposeOnce();
}

void ScHFEditPage::SetNumType(SvxNumType eNumType)
@@ -789,9 +788,9 @@ ScRightHeaderEditPage::ScRightHeaderEditPage( TabPageParent pParent, const SfxIt
                    true )
    {}

VclPtr<SfxTabPage> ScRightHeaderEditPage::Create( TabPageParent pParent, const SfxItemSet* rCoreSet )
std::unique_ptr<SfxTabPage> ScRightHeaderEditPage::Create( TabPageParent pParent, const SfxItemSet* rCoreSet )
{
    return VclPtr<ScRightHeaderEditPage>::Create( pParent, *rCoreSet );
    return std::make_unique<ScRightHeaderEditPage>( pParent, *rCoreSet );
}

// class ScLeftHeaderEditPage
@@ -803,9 +802,9 @@ ScLeftHeaderEditPage::ScLeftHeaderEditPage( TabPageParent pParent, const SfxItem
                    true )
    {}

VclPtr<SfxTabPage> ScLeftHeaderEditPage::Create( TabPageParent pParent, const SfxItemSet* rCoreSet )
std::unique_ptr<SfxTabPage> ScLeftHeaderEditPage::Create( TabPageParent pParent, const SfxItemSet* rCoreSet )
{
    return VclPtr<ScLeftHeaderEditPage>::Create( pParent, *rCoreSet );
    return std::make_unique<ScLeftHeaderEditPage>( pParent, *rCoreSet );
}

// class ScRightFooterEditPage
@@ -817,9 +816,9 @@ ScRightFooterEditPage::ScRightFooterEditPage( TabPageParent pParent, const SfxIt
                    false )
    {}

VclPtr<SfxTabPage> ScRightFooterEditPage::Create( TabPageParent pParent, const SfxItemSet* rCoreSet )
std::unique_ptr<SfxTabPage> ScRightFooterEditPage::Create( TabPageParent pParent, const SfxItemSet* rCoreSet )
{
    return VclPtr<ScRightFooterEditPage>::Create( pParent, *rCoreSet );
    return std::make_unique<ScRightFooterEditPage>( pParent, *rCoreSet );
}

// class ScLeftFooterEditPage
@@ -831,9 +830,9 @@ ScLeftFooterEditPage::ScLeftFooterEditPage( TabPageParent pParent, const SfxItem
                    false )
    {}

VclPtr<SfxTabPage> ScLeftFooterEditPage::Create( TabPageParent pParent, const SfxItemSet* rCoreSet )
std::unique_ptr<SfxTabPage> ScLeftFooterEditPage::Create( TabPageParent pParent, const SfxItemSet* rCoreSet )
{
    return VclPtr<ScLeftFooterEditPage>::Create( pParent, *rCoreSet );
    return std::make_unique<ScLeftFooterEditPage>( pParent, *rCoreSet );
};

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx
index e1f8a0e..604c852 100644
--- a/sc/source/ui/pagedlg/tphf.cxx
+++ b/sc/source/ui/pagedlg/tphf.cxx
@@ -76,13 +76,7 @@ ScHFPage::ScHFPage(TabPageParent pParent, const SfxItemSet& rSet, sal_uInt16 nSe

ScHFPage::~ScHFPage()
{
    disposeOnce();
}

void ScHFPage::dispose()
{
    pStyleDlg = nullptr;
    SvxHFPage::dispose();
}

void ScHFPage::Reset( const SfxItemSet* rSet )
@@ -134,14 +128,6 @@ DeactivateRC ScHFPage::DeactivatePage( SfxItemSet* pSetP )
    return DeactivateRC::LeavePage;
}

void ScHFPage::ActivatePage()
{
}

void ScHFPage::DeactivatePage()
{
}

// Handler:

IMPL_LINK_NOARG(ScHFPage, TurnOnHdl, weld::ToggleButton&, void)
@@ -236,9 +222,9 @@ ScHeaderPage::ScHeaderPage(TabPageParent pParent, const SfxItemSet& rSet)
{
}

VclPtr<SfxTabPage> ScHeaderPage::Create(TabPageParent pParent, const SfxItemSet* rCoreSet)
std::unique_ptr<SfxTabPage> ScHeaderPage::Create(TabPageParent pParent, const SfxItemSet* rCoreSet)
{
    return VclPtr<ScHeaderPage>::Create(pParent, *rCoreSet);
    return std::make_unique<ScHeaderPage>(pParent, *rCoreSet);
}

const sal_uInt16* ScHeaderPage::GetRanges()
@@ -253,9 +239,9 @@ ScFooterPage::ScFooterPage(TabPageParent pParent, const SfxItemSet& rSet)
{
}

VclPtr<SfxTabPage> ScFooterPage::Create(TabPageParent pParent, const SfxItemSet* rCoreSet)
std::unique_ptr<SfxTabPage> ScFooterPage::Create(TabPageParent pParent, const SfxItemSet* rCoreSet)
{
    return VclPtr<ScFooterPage>::Create(pParent, *rCoreSet);
    return std::make_unique<ScFooterPage>(pParent, *rCoreSet);
}

const sal_uInt16* ScFooterPage::GetRanges()
diff --git a/sc/source/ui/pagedlg/tptable.cxx b/sc/source/ui/pagedlg/tptable.cxx
index 5372fa9c..5656364 100644
--- a/sc/source/ui/pagedlg/tptable.cxx
+++ b/sc/source/ui/pagedlg/tptable.cxx
@@ -140,12 +140,11 @@ void ScTablePage::ShowImage()

ScTablePage::~ScTablePage()
{
    disposeOnce();
}

VclPtr<SfxTabPage> ScTablePage::Create(TabPageParent pParent, const SfxItemSet* rCoreSet)
std::unique_ptr<SfxTabPage> ScTablePage::Create(TabPageParent pParent, const SfxItemSet* rCoreSet)
{
    return VclPtr<ScTablePage>::Create(pParent, *rCoreSet);
    return std::make_unique<ScTablePage>(pParent, *rCoreSet);
}

void ScTablePage::Reset( const SfxItemSet* rCoreSet )
@@ -355,13 +354,6 @@ DeactivateRC ScTablePage::DeactivatePage( SfxItemSet* pSetP )
    return DeactivateRC::LeavePage;
}

void ScTablePage::DataChanged( const DataChangedEvent& rDCEvt )
{
    if( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) )
        ShowImage();
    SfxTabPage::DataChanged( rDCEvt );
}

// Handler:

IMPL_LINK_NOARG(ScTablePage, PageDirHdl, weld::ToggleButton&, void)
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index 28f949c..8d72ef4 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -524,13 +524,13 @@ bool ScPreviewShell::HasPrintOptionsPage() const
    return true;
}

VclPtr<SfxTabPage> ScPreviewShell::CreatePrintOptionsPage(TabPageParent pParent, const SfxItemSet &rOptions)
std::unique_ptr<SfxTabPage> ScPreviewShell::CreatePrintOptionsPage(TabPageParent pParent, const SfxItemSet &rOptions)
{
    ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
    ::CreateTabPage ScTpPrintOptionsCreate = pFact->GetTabPageCreatorFunc(RID_SC_TP_PRINT);
    if ( ScTpPrintOptionsCreate )
        return ScTpPrintOptionsCreate(pParent, &rOptions);
    return VclPtr<SfxTabPage>();
    return nullptr;
}

void ScPreviewShell::Activate(bool bMDI)
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index a99a049..4c90704 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1035,13 +1035,13 @@ bool ScTabViewShell::HasPrintOptionsPage() const
    return true;
}

VclPtr<SfxTabPage> ScTabViewShell::CreatePrintOptionsPage(TabPageParent pParent, const SfxItemSet &rOptions )
std::unique_ptr<SfxTabPage> ScTabViewShell::CreatePrintOptionsPage(TabPageParent pParent, const SfxItemSet &rOptions )
{
    ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
    ::CreateTabPage ScTpPrintOptionsCreate = pFact->GetTabPageCreatorFunc(RID_SC_TP_PRINT);
    if ( ScTpPrintOptionsCreate )
        return ScTpPrintOptionsCreate(pParent, &rOptions);
    return VclPtr<SfxTabPage>();
    return nullptr;
}

void ScTabViewShell::StopEditShell()
diff --git a/sd/inc/sdmod.hxx b/sd/inc/sdmod.hxx
index bcc8a56..a747e91 100644
--- a/sd/inc/sdmod.hxx
+++ b/sd/inc/sdmod.hxx
@@ -112,7 +112,7 @@ public:
    // virtual methods for the option dialog
    virtual std::unique_ptr<SfxItemSet> CreateItemSet( sal_uInt16 nId ) override;
    virtual void         ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) override;
    virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet ) override;
    virtual std::unique_ptr<SfxTabPage> CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet ) override;
    virtual std::unique_ptr<SfxStyleFamilies> CreateStyleFamilies() override;

    SdExtPropertySetInfoCache gImplImpressPropertySetInfoCache;
diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx
index 5379f25..971ef20c 100644
--- a/sd/source/ui/app/sdmod2.cxx
+++ b/sd/source/ui/app/sdmod2.cxx
@@ -730,9 +730,9 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet )
        pViewShell->GetViewFrame()->GetBindings().InvalidateAll( true );
}

VclPtr<SfxTabPage> SdModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet )
std::unique_ptr<SfxTabPage> SdModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet )
{
    VclPtr<SfxTabPage> pRet;
    std::unique_ptr<SfxTabPage> xRet;
    SfxAllItemSet aSet(*(rSet.GetPool()));
    SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();

@@ -743,7 +743,7 @@ VclPtr<SfxTabPage> SdModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParen
        {
            ::CreateTabPage fnCreatePage = pFact->GetSdOptionsContentsTabPageCreatorFunc();
            if( fnCreatePage )
                pRet = (*fnCreatePage)( pParent, &rSet );
                xRet = (*fnCreatePage)( pParent, &rSet );
        }
        break;
        case SID_SD_TP_SNAP:
@@ -751,7 +751,7 @@ VclPtr<SfxTabPage> SdModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParen
        {
            ::CreateTabPage fnCreatePage = pFact->GetSdOptionsSnapTabPageCreatorFunc();
            if( fnCreatePage )
                pRet = (*fnCreatePage)( pParent, &rSet );
                xRet = (*fnCreatePage)( pParent, &rSet );
        }
        break;
        case SID_SD_TP_PRINT:
@@ -760,10 +760,10 @@ VclPtr<SfxTabPage> SdModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParen
            ::CreateTabPage fnCreatePage = pFact->GetSdPrintOptionsTabPageCreatorFunc();
            if( fnCreatePage )
            {
                pRet = (*fnCreatePage)( pParent, &rSet );
                xRet = (*fnCreatePage)( pParent, &rSet );
                if(SID_SD_TP_PRINT == nId)
                    aSet.Put (SfxUInt32Item(SID_SDMODE_FLAG,SD_DRAW_MODE));
                pRet->PageCreated(aSet);
                xRet->PageCreated(aSet);
            }
        }
        break;
@@ -773,12 +773,12 @@ VclPtr<SfxTabPage> SdModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParen
            ::CreateTabPage fnCreatePage = pFact->GetSdOptionsMiscTabPageCreatorFunc();
            if( fnCreatePage )
            {
                pRet = (*fnCreatePage)( pParent, &rSet );
                xRet = (*fnCreatePage)( pParent, &rSet );
                if(SID_SD_TP_MISC == nId)
                    aSet.Put (SfxUInt32Item(SID_SDMODE_FLAG,SD_DRAW_MODE));
                else
                    aSet.Put (SfxUInt32Item(SID_SDMODE_FLAG,SD_IMPRESS_MODE));
                pRet->PageCreated(aSet);
                xRet->PageCreated(aSet);
            }
        }
        break;
@@ -787,13 +787,13 @@ VclPtr<SfxTabPage> SdModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParen
            SfxAbstractDialogFactory* pSfxFact = SfxAbstractDialogFactory::Create();
            ::CreateTabPage fnCreatePage = pSfxFact->GetTabPageCreatorFunc( nId );
            if ( fnCreatePage )
                pRet = (*fnCreatePage)( pParent, &rSet );
                xRet = (*fnCreatePage)( pParent, &rSet );
        }
        break;
    }
    DBG_ASSERT( pRet, "SdModule::CreateTabPage(): no valid ID for TabPage!" );
    DBG_ASSERT( xRet, "SdModule::CreateTabPage(): no valid ID for TabPage!" );

    return pRet;
    return xRet;
}

std::unique_ptr<SfxStyleFamilies> SdModule::CreateStyleFamilies()
diff --git a/sd/source/ui/dlg/paragr.cxx b/sd/source/ui/dlg/paragr.cxx
index 4db421f..7b35e7a 100644
--- a/sd/source/ui/dlg/paragr.cxx
+++ b/sd/source/ui/dlg/paragr.cxx
@@ -35,8 +35,8 @@ class SdParagraphNumTabPage : public SfxTabPage
{
public:
    SdParagraphNumTabPage(TabPageParent pParent, const SfxItemSet& rSet);
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rSet );

    static VclPtr<SfxTabPage>  Create( TabPageParent pParent, const SfxItemSet* rSet );
    static const sal_uInt16*  GetRanges();

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
@@ -62,9 +62,9 @@ SdParagraphNumTabPage::SdParagraphNumTabPage(TabPageParent pParent, const SfxIte
    m_xNewStartNumberCB->connect_clicked(LINK(this, SdParagraphNumTabPage, ImplNewStartHdl));
}

VclPtr<SfxTabPage> SdParagraphNumTabPage::Create(TabPageParent pParent, const SfxItemSet * rAttrSet)
std::unique_ptr<SfxTabPage> SdParagraphNumTabPage::Create(TabPageParent pParent, const SfxItemSet * rAttrSet)
{
    return VclPtr<SdParagraphNumTabPage>::Create(pParent, *rAttrSet);
    return std::make_unique<SdParagraphNumTabPage>(pParent, *rAttrSet);
}

const sal_uInt16* SdParagraphNumTabPage::GetRanges()
diff --git a/sd/source/ui/dlg/prntopts.cxx b/sd/source/ui/dlg/prntopts.cxx
index 74d0f46..637954d 100644
--- a/sd/source/ui/dlg/prntopts.cxx
+++ b/sd/source/ui/dlg/prntopts.cxx
@@ -175,10 +175,10 @@ void SdPrintOptions::Reset( const SfxItemSet* rAttrs )
    updateControls();
}

VclPtr<SfxTabPage> SdPrintOptions::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> SdPrintOptions::Create( TabPageParent pParent,
                                           const SfxItemSet* rOutAttrs )
{
    return VclPtr<SdPrintOptions>::Create( pParent, *rOutAttrs );
    return std::make_unique<SdPrintOptions>( pParent, *rOutAttrs );
}

IMPL_LINK(SdPrintOptions, ClickCheckboxHdl, weld::ToggleButton&, rCbx, void)
diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx
index 389ccd6..467e928 100644
--- a/sd/source/ui/dlg/tpaction.cxx
+++ b/sd/source/ui/dlg/tpaction.cxx
@@ -74,13 +74,13 @@ SdActionDlg::SdActionDlg(weld::Window* pParent, const SfxItemSet* pAttr, ::sd::V
    , rOutAttrs(*pAttr)
{
    TabPageParent aParent(get_content_area(), this);
    VclPtr<SfxTabPage> xNewPage = SdTPAction::Create(aParent, rOutAttrs);
    std::unique_ptr<SfxTabPage> xNewPage = SdTPAction::Create(aParent, rOutAttrs);

    // formerly in PageCreated
    static_cast<SdTPAction*>( xNewPage.get() )->SetView( pView );
    static_cast<SdTPAction*>( xNewPage.get() )->Construct();

    SetTabPage(xNewPage);
    SetTabPage(std::move(xNewPage));
}

/**
@@ -128,7 +128,6 @@ SdTPAction::SdTPAction(TabPageParent pWindow, const SfxItemSet& rInAttrs)

SdTPAction::~SdTPAction()
{
    disposeOnce();
}

void SdTPAction::SetView( const ::sd::View* pSdView )
@@ -344,10 +343,9 @@ DeactivateRC SdTPAction::DeactivatePage( SfxItemSet* pPageSet )
    return DeactivateRC::LeavePage;
}

VclPtr<SfxTabPage> SdTPAction::Create( TabPageParent pParent,
                                       const SfxItemSet& rAttrs )
std::unique_ptr<SfxTabPage> SdTPAction::Create(TabPageParent pParent, const SfxItemSet& rAttrs)
{
    return VclPtr<SdTPAction>::Create( pParent, rAttrs );
    return std::make_unique<SdTPAction>( pParent, rAttrs );
}

void SdTPAction::UpdateTree()
diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx
index 9e9f8c1..d78a819 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -95,10 +95,10 @@ void SdTpOptionsSnap::Reset( const SfxItemSet* rAttrs )
    ClickRotateHdl_Impl(*m_xCbxRotate);
}

VclPtr<SfxTabPage> SdTpOptionsSnap::Create( TabPageParent pWindow,
std::unique_ptr<SfxTabPage> SdTpOptionsSnap::Create( TabPageParent pWindow,
                                            const SfxItemSet* rAttrs )
{
    return VclPtr<SdTpOptionsSnap>::Create(pWindow, *rAttrs);
    return std::make_unique<SdTpOptionsSnap>(pWindow, *rAttrs);
}

/*************************************************************************
@@ -157,10 +157,10 @@ void SdTpOptionsContents::Reset( const SfxItemSet* rAttrs )
    m_xCbxHandlesBezier->save_state();
}

VclPtr<SfxTabPage> SdTpOptionsContents::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> SdTpOptionsContents::Create( TabPageParent pParent,
                                                const SfxItemSet* rAttrs )
{
    return VclPtr<SdTpOptionsContents>::Create( pParent, *rAttrs );
    return std::make_unique<SdTpOptionsContents>(pParent, *rAttrs);
}

/*************************************************************************
@@ -473,10 +473,10 @@ void SdTpOptionsMisc::Reset( const SfxItemSet* rAttrs )
    UpdateCompatibilityControls ();
}

VclPtr<SfxTabPage> SdTpOptionsMisc::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> SdTpOptionsMisc::Create( TabPageParent pParent,
                                            const SfxItemSet* rAttrs )
{
    return VclPtr<SdTpOptionsMisc>::Create( pParent, *rAttrs );
    return std::make_unique<SdTpOptionsMisc>( pParent, *rAttrs );
}

IMPL_LINK_NOARG(SdTpOptionsMisc, SelectMetricHdl_Impl, weld::ComboBox&, void)
diff --git a/sd/source/ui/inc/prntopts.hxx b/sd/source/ui/inc/prntopts.hxx
index 46077ef..2ed29ac 100644
--- a/sd/source/ui/inc/prntopts.hxx
+++ b/sd/source/ui/inc/prntopts.hxx
@@ -52,12 +52,11 @@ private:

    void updateControls();

    using OutputDevice::SetDrawMode;
public:
    SdPrintOptions(TabPageParent pParent, const SfxItemSet& rInAttrs);
    virtual ~SdPrintOptions() override;

    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/sd/source/ui/inc/tpaction.hxx b/sd/source/ui/inc/tpaction.hxx
index bd862e2..fec2110 100644
--- a/sd/source/ui/inc/tpaction.hxx
+++ b/sd/source/ui/inc/tpaction.hxx
@@ -90,7 +90,7 @@ public:
    SdTPAction(TabPageParent pParent, const SfxItemSet& rInAttrs);
    virtual ~SdTPAction() override;

    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;
@@ -101,9 +101,6 @@ public:
    void    Construct();

    void    SetView( const ::sd::View* pSdView );

    using TabPage::ActivatePage;
    using TabPage::DeactivatePage;
};

#endif // INCLUDED_SD_SOURCE_UI_INC_TPACTION_HXX
diff --git a/sd/source/ui/inc/tpoption.hxx b/sd/source/ui/inc/tpoption.hxx
index c4d17ef..fd1a300 100644
--- a/sd/source/ui/inc/tpoption.hxx
+++ b/sd/source/ui/inc/tpoption.hxx
@@ -30,9 +30,9 @@ class SdTpOptionsSnap : public SvxGridTabPage
{
public:
    SdTpOptionsSnap(TabPageParent pParent, const SfxItemSet& rInAttrs);
    static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* );
    virtual ~SdTpOptionsSnap() override;

    static  VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* );
    virtual bool FillItemSet( SfxItemSet* ) override;
    virtual void Reset( const SfxItemSet * ) override;
};
@@ -50,9 +50,9 @@ private:

public:
    SdTpOptionsContents(TabPageParent pParent, const SfxItemSet& rInAttrs);
    static  std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* );
    virtual ~SdTpOptionsContents() override;

    static  VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* );
    virtual bool FillItemSet( SfxItemSet* ) override;
    virtual void Reset( const SfxItemSet * ) override;
};
@@ -123,9 +123,9 @@ protected:

public:
    SdTpOptionsMisc(TabPageParent pParent, const SfxItemSet& rInAttrs);
    static std::unique_ptr<SfxTabPage> Create( TabPageParent, const SfxItemSet* );
    virtual ~SdTpOptionsMisc() override;

    static  VclPtr<SfxTabPage> Create( TabPageParent, const SfxItemSet* );
    virtual bool FillItemSet( SfxItemSet* ) override;
    virtual void Reset( const SfxItemSet * ) override;

@@ -141,11 +141,6 @@ public:
    */
    void SetImpressMode();
    virtual void        PageCreated(const SfxAllItemSet& aSet) override;

    using TabPage::ActivatePage;
    using TabPage::DeactivatePage;
    using OutputDevice::SetDrawMode;

};

#endif // INCLUDED_SD_SOURCE_UI_INC_TPOPTION_HXX
diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx
index cd0070f..dbdf7b1 100644
--- a/sfx2/source/appl/module.cxx
+++ b/sfx2/source/appl/module.cxx
@@ -188,9 +188,9 @@ SfxChildWinFactArr_Impl* SfxModule::GetChildWinFactories_Impl() const
    return pImpl->pFactArr.get();
}

VclPtr<SfxTabPage> SfxModule::CreateTabPage(sal_uInt16, TabPageParent, const SfxItemSet&)
std::unique_ptr<SfxTabPage> SfxModule::CreateTabPage(sal_uInt16, TabPageParent, const SfxItemSet&)
{
    return VclPtr<SfxTabPage>();
    return nullptr;
}

void SfxModule::Invalidate( sal_uInt16 nId )
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 243da29..139e9ea 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -503,7 +503,6 @@ SfxSingleTabDialogController::SfxSingleTabDialogController(weld::Widget *pParent

SfxSingleTabDialogController::~SfxSingleTabDialogController()
{
    m_xSfxPage.disposeAndClear();
}

/*  [Description]
@@ -512,11 +511,9 @@ SfxSingleTabDialogController::~SfxSingleTabDialogController()
    The passed on page is initialized with the initially given Itemset
    through calling Reset().
*/
void SfxSingleTabDialogController::SetTabPage(SfxTabPage* pTabPage)
void SfxSingleTabDialogController::SetTabPage(std::unique_ptr<SfxTabPage> xTabPage)
{
    m_xSfxPage.disposeAndClear();
    m_xSfxPage = pTabPage;

    m_xSfxPage = std::move(xTabPage);
    if (!m_xSfxPage)
        return;

@@ -532,7 +529,7 @@ void SfxSingleTabDialogController::SetTabPage(SfxTabPage* pTabPage)
    m_xHelpBtn->set_visible(Help::IsContextHelpEnabled());

    // Set TabPage text in the Dialog if there is any
    OUString sTitle(m_xSfxPage->GetText());
    OUString sTitle(m_xSfxPage->GetPageTitle());
    if (!sTitle.isEmpty())
        m_xDialog->set_title(sTitle);

diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 782d4fa..b2beb7a 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -617,9 +617,9 @@ SfxDocumentDescPage::~SfxDocumentDescPage()
{
}

VclPtr<SfxTabPage> SfxDocumentDescPage::Create(TabPageParent pParent, const SfxItemSet *rItemSet)
std::unique_ptr<SfxTabPage> SfxDocumentDescPage::Create(TabPageParent pParent, const SfxItemSet *rItemSet)
{
     return VclPtr<SfxDocumentDescPage>::Create(pParent, *rItemSet);
     return std::make_unique<SfxDocumentDescPage>(pParent, *rItemSet);
}

bool SfxDocumentDescPage::FillItemSet(SfxItemSet *rSet)
@@ -743,7 +743,6 @@ SfxDocumentPage::SfxDocumentPage(TabPageParent pParent, const SfxItemSet& rItemS

SfxDocumentPage::~SfxDocumentPage()
{
    disposeOnce();
}

IMPL_LINK_NOARG(SfxDocumentPage, DeleteHdl, weld::Button&, void)
@@ -768,7 +767,7 @@ IMPL_LINK_NOARG(SfxDocumentPage, SignatureHdl, weld::Button&, void)
    SfxObjectShell* pDoc = SfxObjectShell::Current();
    if( pDoc )
    {
        pDoc->SignDocumentContent(GetFrameWeld());
        pDoc->SignDocumentContent(GetDialogFrameWeld());

        ImplUpdateSignatures();
    }
@@ -788,7 +787,7 @@ IMPL_LINK_NOARG(SfxDocumentPage, ChangePassHdl, weld::Button&, void)
        if (!pFilter)
            break;

        sfx2::RequestPassword(pFilter, OUString(), pMedSet, VCLUnoHelper::GetInterface(GetParentDialog()));
        sfx2::RequestPassword(pFilter, OUString(), pMedSet, GetDialogFrameWeld()->GetXWindow());
        pShell->SetModified();
    }
    while (false);
@@ -857,9 +856,9 @@ void SfxDocumentPage::ImplCheckPasswordState()
    m_xChangePassBtn->set_sensitive(false);
}

VclPtr<SfxTabPage> SfxDocumentPage::Create( TabPageParent pParent, const SfxItemSet* rItemSet )
std::unique_ptr<SfxTabPage> SfxDocumentPage::Create( TabPageParent pParent, const SfxItemSet* rItemSet )
{
     return VclPtr<SfxDocumentPage>::Create( pParent, *rItemSet );
     return std::make_unique<SfxDocumentPage>(pParent, *rItemSet);
}

void SfxDocumentPage::EnableUseUserData()
@@ -1864,13 +1863,7 @@ SfxCustomPropertiesPage::SfxCustomPropertiesPage(TabPageParent pParent, const Sf

SfxCustomPropertiesPage::~SfxCustomPropertiesPage()
{
    disposeOnce();
}

void SfxCustomPropertiesPage::dispose()
{
    m_xPropertiesCtrl.reset();
    SfxTabPage::dispose();
}

IMPL_LINK_NOARG(SfxCustomPropertiesPage, AddHdl, weld::Button&, void)
@@ -1953,9 +1946,9 @@ DeactivateRC SfxCustomPropertiesPage::DeactivatePage( SfxItemSet* /*pSet*/ )
    return nRet;
}

VclPtr<SfxTabPage> SfxCustomPropertiesPage::Create( TabPageParent pParent, const SfxItemSet* rItemSet )
std::unique_ptr<SfxTabPage> SfxCustomPropertiesPage::Create( TabPageParent pParent, const SfxItemSet* rItemSet )
{
    return VclPtr<SfxCustomPropertiesPage>::Create( pParent, *rItemSet );
    return std::make_unique<SfxCustomPropertiesPage>(pParent, *rItemSet);
}

CmisValue::CmisValue(weld::Widget* pParent, const OUString& aStr)
@@ -2253,14 +2246,9 @@ SfxCmisPropertiesPage::SfxCmisPropertiesPage(TabPageParent pParent, const SfxIte

}

void SfxCmisPropertiesPage::dispose()
{
    m_xPropertiesCtrl.reset();
    SfxTabPage::dispose();
}

SfxCmisPropertiesPage::~SfxCmisPropertiesPage()
{
    m_xPropertiesCtrl.reset();
}

bool SfxCmisPropertiesPage::FillItemSet( SfxItemSet* rSet )
@@ -2351,9 +2339,9 @@ DeactivateRC SfxCmisPropertiesPage::DeactivatePage( SfxItemSet* /*pSet*/ )
    return DeactivateRC::LeavePage;
}

VclPtr<SfxTabPage> SfxCmisPropertiesPage::Create( TabPageParent pParent, const SfxItemSet* rItemSet )
std::unique_ptr<SfxTabPage> SfxCmisPropertiesPage::Create( TabPageParent pParent, const SfxItemSet* rItemSet )
{
    return VclPtr<SfxCmisPropertiesPage>::Create( pParent, *rItemSet );
    return std::make_unique<SfxCmisPropertiesPage>(pParent, *rItemSet);
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/dialog/documentfontsdialog.cxx b/sfx2/source/dialog/documentfontsdialog.cxx
index 73e9aad..8f52125 100644
--- a/sfx2/source/dialog/documentfontsdialog.cxx
+++ b/sfx2/source/dialog/documentfontsdialog.cxx
@@ -26,9 +26,9 @@

using namespace ::com::sun::star;

VclPtr<SfxTabPage> SfxDocumentFontsPage::Create(TabPageParent pParent, const SfxItemSet* set)
std::unique_ptr<SfxTabPage> SfxDocumentFontsPage::Create(TabPageParent pParent, const SfxItemSet* set)
{
    return VclPtr<SfxDocumentFontsPage>::Create(pParent, *set);
    return std::make_unique<SfxDocumentFontsPage>(pParent, *set);
}

SfxDocumentFontsPage::SfxDocumentFontsPage(TabPageParent parent, const SfxItemSet& set)
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index 1a69d53..eb43042 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -253,15 +253,9 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(TabPageParent pParent, const Sf

SfxManageStyleSheetPage::~SfxManageStyleSheetPage()
{
    disposeOnce();
}

void SfxManageStyleSheetPage::dispose()
{
    pFamilies.reset();
    pItem = nullptr;
    pStyle = nullptr;
    SfxTabPage::dispose();
}

void SfxManageStyleSheetPage::UpdateName_Impl( weld::ComboBox* pBox,
@@ -532,10 +526,10 @@ void SfxManageStyleSheetPage::Reset( const SfxItemSet* /*rAttrSet*/ )
    }
}

VclPtr<SfxTabPage> SfxManageStyleSheetPage::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> SfxManageStyleSheetPage::Create( TabPageParent pParent,
                                                    const SfxItemSet *rAttrSet )
{
    return VclPtr<SfxManageStyleSheetPage>::Create(pParent, *rAttrSet);
    return std::make_unique<SfxManageStyleSheetPage>(pParent, *rAttrSet);
}

void SfxManageStyleSheetPage::ActivatePage( const SfxItemSet& rSet)
@@ -595,7 +589,7 @@ DeactivateRC SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet )

        if (!pStyle->SetName(comphelper::string::stripStart(m_xName->get_text(), ' ')))
        {
            std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
            std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetDialogFrameWeld(),
                                                                     VclMessageType::Info, VclButtonsType::Ok,
                                                                     SfxResId(STR_TABPAGE_INVALIDNAME)));
            xBox->run();
@@ -614,7 +608,7 @@ DeactivateRC SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet )
        {
            if ( !pStyle->SetFollow( aFollowEntry ) )
            {
                std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
                std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetDialogFrameWeld(),
                                                                         VclMessageType::Info, VclButtonsType::Ok,
                                                                         SfxResId(STR_TABPAGE_INVALIDSTYLE)));
                xBox->run();
@@ -636,7 +630,7 @@ DeactivateRC SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet )
        {
            if ( !pStyle->SetParent( aParentEntry ) )
            {
                std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
                std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetDialogFrameWeld(),
                                                                         VclMessageType::Info, VclButtonsType::Ok,
                                                                         SfxResId(STR_TABPAGE_INVALIDPARENT)));
                xBox->run();
diff --git a/sfx2/source/dialog/printopt.cxx b/sfx2/source/dialog/printopt.cxx
index 09994c5..cbd3d94 100644
--- a/sfx2/source/dialog/printopt.cxx
+++ b/sfx2/source/dialog/printopt.cxx
@@ -86,9 +86,9 @@ SfxCommonPrintOptionsTabPage::~SfxCommonPrintOptionsTabPage()
{
}

VclPtr<SfxTabPage> SfxCommonPrintOptionsTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet )
std::unique_ptr<SfxTabPage> SfxCommonPrintOptionsTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet )
{
    return VclPtr<SfxCommonPrintOptionsTabPage>::Create( pParent, *rAttrSet );
    return std::make_unique<SfxCommonPrintOptionsTabPage>(pParent, *rAttrSet);
}

bool SfxCommonPrintOptionsTabPage::FillItemSet( SfxItemSet* /*rSet*/ )
diff --git a/sfx2/source/dialog/securitypage.cxx b/sfx2/source/dialog/securitypage.cxx
index fcafc16..dfc3ddb 100644
--- a/sfx2/source/dialog/securitypage.cxx
+++ b/sfx2/source/dialog/securitypage.cxx
@@ -320,7 +320,7 @@ IMPL_LINK_NOARG(SfxSecurityPage_Impl, RecordChangesCBToggleHdl, weld::ToggleButt
    bool bAlreadyDone = false;
    if (!m_bEndRedliningWarningDone)
    {
        std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(m_rMyTabPage.GetFrameWeld(),
        std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(m_rMyTabPage.GetDialogFrameWeld(),
                                                   VclMessageType::Warning, VclButtonsType::YesNo,
                                                   m_aEndRedliningWarning));
        xWarn->set_default_response(RET_NO);
@@ -337,7 +337,7 @@ IMPL_LINK_NOARG(SfxSecurityPage_Impl, RecordChangesCBToggleHdl, weld::ToggleButt
        OUString aPasswordText;

        // dialog canceled or no password provided
        if (!lcl_GetPassword( m_rMyTabPage.GetFrameWeld(), false, aPasswordText ))
        if (!lcl_GetPassword( m_rMyTabPage.GetDialogFrameWeld(), false, aPasswordText ))
            bAlreadyDone = true;

        // ask for password and if dialog is canceled or no password provided return
@@ -375,7 +375,7 @@ IMPL_LINK_NOARG(SfxSecurityPage_Impl, ChangeProtectionPBHdl, weld::Button&, void
    if (bNeedPassword)
    {
        // ask for password and if dialog is canceled or no password provided return
        if (!lcl_GetPassword(m_rMyTabPage.GetFrameWeld(), bNewProtection, aPasswordText))
        if (!lcl_GetPassword(m_rMyTabPage.GetDialogFrameWeld(), bNewProtection, aPasswordText))
            return;

        // provided password still needs to be checked?
@@ -400,9 +400,9 @@ IMPL_LINK_NOARG(SfxSecurityPage_Impl, ChangeProtectionPBHdl, weld::Button&, void
    m_xProtectPB->set_visible(!bNewProtection);
}

VclPtr<SfxTabPage> SfxSecurityPage::Create(TabPageParent pParent, const SfxItemSet * rItemSet)
std::unique_ptr<SfxTabPage> SfxSecurityPage::Create(TabPageParent pParent, const SfxItemSet * rItemSet)
{
    return VclPtr<SfxSecurityPage>::Create(pParent, *rItemSet);
    return std::make_unique<SfxSecurityPage>(pParent, *rItemSet);
}

SfxSecurityPage::SfxSecurityPage(TabPageParent pParent, const SfxItemSet& rItemSet)
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index b2f7f77..b3299c6 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -51,11 +51,10 @@ using namespace ::com::sun::star::uno;
struct TabPageImpl
{
    bool                        mbStandard;
    weld::DialogController*     mpDialogController;
    SfxOkDialogController*      mpSfxDialogController;
    css::uno::Reference< css::frame::XFrame > mxFrame;

    TabPageImpl() : mbStandard(false), mpDialogController(nullptr), mpSfxDialogController(nullptr) {}
    TabPageImpl() : mbStandard(false), mpSfxDialogController(nullptr) {}
};

struct Data_Impl
@@ -63,7 +62,7 @@ struct Data_Impl
    OString const sId;                  // The ID
    CreateTabPage fnCreatePage;   // Pointer to Factory
    GetTabPageRanges fnGetRanges; // Pointer to Ranges-Function
    VclPtr<SfxTabPage> pTabPage;         // The TabPage itself
    std::unique_ptr<SfxTabPage> xTabPage;         // The TabPage itself
    bool bRefresh;                // Flag: Page must be re-initialized

    // Constructor
@@ -73,7 +72,6 @@ struct Data_Impl
        sId         ( rId ),
        fnCreatePage( fnPage ),
        fnGetRanges ( fnRanges ),
        pTabPage    ( nullptr ),
        bRefresh    ( false )
    {
    }
@@ -140,16 +138,12 @@ css::uno::Reference< css::frame::XFrame > SfxTabPage::GetFrame() const
}

SfxTabPage::SfxTabPage(TabPageParent pParent, const OUString& rUIXMLDescription, const OString& rID, const SfxItemSet *rAttrSet)
    : TabPage(pParent.pPage ? Application::GetDefDialogParent() : pParent.pParent.get()) //just drag this along hidden in this scenario
    : BuilderPage(pParent.pPage, pParent.pController, rUIXMLDescription, rID)
    , pSet                ( rAttrSet )
    , bHasExchangeSupport ( false )
    , pImpl               ( new TabPageImpl )
    , m_xBuilder(pParent.pPage ? Application::CreateBuilder(pParent.pPage, rUIXMLDescription)
                               : Application::CreateInterimBuilder(this, rUIXMLDescription))
    , m_xContainer(m_xBuilder->weld_container(rID))
{
    pImpl->mpDialogController = pParent.pController;
    pImpl->mpSfxDialogController = dynamic_cast<SfxOkDialogController*>(pImpl->mpDialogController);
    pImpl->mpSfxDialogController = dynamic_cast<SfxOkDialogController*>(m_pDialogController);
}

SfxTabPage::~SfxTabPage()
@@ -161,14 +155,8 @@ SfxTabPage::~SfxTabPage()
            xParent->move(m_xContainer.get(), nullptr);
    }
    m_xContainer.reset();
    disposeOnce();
}

void SfxTabPage::dispose()
{
    pImpl.reset();
    m_xBuilder.reset();
    TabPage::dispose();
}

bool SfxTabPage::FillItemSet( SfxItemSet* )
@@ -286,7 +274,7 @@ void SfxTabPage::ChangesApplied()
void SfxTabPage::SetDialogController(SfxOkDialogController* pDialog)
{
    pImpl->mpSfxDialogController = pDialog;
    pImpl->mpDialogController = pImpl->mpSfxDialogController;
    m_pDialogController = pImpl->mpSfxDialogController;
}

SfxOkDialogController* SfxTabPage::GetDialogController() const
@@ -294,21 +282,18 @@ SfxOkDialogController* SfxTabPage::GetDialogController() const
    return pImpl->mpSfxDialogController;
}

OString SfxTabPage::GetConfigId() const
OString SfxTabPage::GetHelpId() const
{
    if (m_xContainer)
        return m_xContainer->get_help_id();
    OString sId(GetHelpId());
    if (sId.isEmpty() && isLayoutEnabled(this))
        sId = GetWindow(GetWindowType::FirstChild)->GetHelpId();
    return sId;
    return OString();
}

weld::Window* SfxTabPage::GetDialogFrameWeld() const
{
    if (pImpl->mpDialogController)
        return pImpl->mpDialogController->getDialog();
    return GetFrameWeld();
    if (m_pDialogController)
        return m_pDialogController->getDialog();
    return nullptr;
}

const SfxItemSet* SfxTabPage::GetDialogExampleSet() const
@@ -420,7 +405,7 @@ IMPL_LINK_NOARG(SfxTabDialogController, ResetHdl, weld::Button&, void)
    Data_Impl* pDataObject = Find(m_pImpl->aData, m_xTabCtrl->get_current_page_ident());
    assert(pDataObject && "Id not known");

    pDataObject->pTabPage->Reset(m_pSet.get());
    pDataObject->xTabPage->Reset(m_pSet.get());
    // Also reset relevant items of ExampleSet and OutSet to initial state
    if (!pDataObject->fnGetRanges)
        return;
@@ -519,9 +504,9 @@ IMPL_LINK_NOARG(SfxTabDialogController, BaseFmtHdl, weld::Button&, void)
        pTmpRanges += 2;
    }
    // Set all Items as new  -> the call the current Page Reset()
    assert(pDataObject->pTabPage && "the Page is gone");
    pDataObject->pTabPage->Reset( &aTmpSet );
    pDataObject->pTabPage->pImpl->mbStandard = true;
    assert(pDataObject->xTabPage && "the Page is gone");
    pDataObject->xTabPage->Reset( &aTmpSet );
    pDataObject->xTabPage->pImpl->mbStandard = true;
}

IMPL_LINK(SfxTabDialogController, ActivatePageHdl, const OString&, rPage, void)
@@ -542,7 +527,7 @@ IMPL_LINK(SfxTabDialogController, ActivatePageHdl, const OString&, rPage, void)
        return;
    }

    VclPtr<SfxTabPage> pTabPage = pDataObject->pTabPage;
    SfxTabPage* pTabPage = pDataObject->xTabPage.get();
    if (!pTabPage)
        return;

@@ -579,7 +564,7 @@ IMPL_LINK(SfxTabDialogController, DeactivatePageHdl, const OString&, rPage, bool
        return false;
    }

    VclPtr<SfxTabPage> pPage = pDataObject->pTabPage;
    SfxTabPage* pPage = pDataObject->xTabPage.get();
    if (!pPage)
        return true;

@@ -625,7 +610,7 @@ IMPL_LINK(SfxTabDialogController, DeactivatePageHdl, const OString&, rPage, bool

        for (auto const& elem : m_pImpl->aData)
        {
            elem->bRefresh = ( elem->pTabPage.get() != pPage ); // Do not refresh own Page anymore
            elem->bRefresh = ( elem->xTabPage.get() != pPage ); // Do not refresh own Page anymore
        }
    }
    return static_cast<bool>(nRet & DeactivateRC::LeavePage);
@@ -636,7 +621,7 @@ bool SfxTabDialogController::PrepareLeaveCurrentPage()
    const OString sId = m_xTabCtrl->get_current_page_ident();
    Data_Impl* pDataObject = Find(m_pImpl->aData, sId);
    DBG_ASSERT( pDataObject, "Id not known" );
    VclPtr<SfxTabPage> pPage = pDataObject ? pDataObject->pTabPage : nullptr;
    SfxTabPage* pPage = pDataObject ? pDataObject->xTabPage.get() : nullptr;

    bool bEnd = !pPage;

@@ -737,21 +722,21 @@ SfxTabDialogController::~SfxTabDialogController()

    for (auto & elem : m_pImpl->aData)
    {
        if ( elem->pTabPage )
        if ( elem->xTabPage )
        {
            // save settings of all pages (user data)
            elem->pTabPage->FillUserData();
            OUString aPageData( elem->pTabPage->GetUserData() );
            elem->xTabPage->FillUserData();
            OUString aPageData( elem->xTabPage->GetUserData() );
            if ( !aPageData.isEmpty() )
            {
                // save settings of all pages (user data)
                OUString sConfigId = OStringToOUString(elem->pTabPage->GetConfigId(),
                OUString sConfigId = OStringToOUString(elem->xTabPage->GetConfigId(),
                    RTL_TEXTENCODING_UTF8);
                SvtViewOptions aPageOpt(EViewType::TabPage, sConfigId);
                aPageOpt.SetUserItem( USERITEM_NAME, makeAny( aPageData ) );
            }

            elem->pTabPage.disposeAndClear();
            elem->xTabPage.reset();
        }
        delete elem;
        elem = nullptr;
@@ -790,7 +775,7 @@ short SfxTabDialogController::Ok()

    for (auto const& elem : m_pImpl->aData)
    {
        SfxTabPage* pTabPage = elem->pTabPage;
        SfxTabPage* pTabPage = elem->xTabPage.get();

        if ( pTabPage )
        {
@@ -912,28 +897,28 @@ void SfxTabDialogController::CreatePages()
{
    for (auto pDataObject : m_pImpl->aData)
    {
        if (pDataObject->pTabPage)
        if (pDataObject->xTabPage)
           continue;
        weld::Container* pPage = m_xTabCtrl->get_page(pDataObject->sId);
        // TODO eventually pass DialogController as distinct argument instead of bundling into TabPageParent

        TabPageParent aParent(pPage, this);
        if (m_pSet)
            pDataObject->pTabPage = (pDataObject->fnCreatePage)(aParent, m_pSet.get());
            pDataObject->xTabPage = (pDataObject->fnCreatePage)(aParent, m_pSet.get());
        else
            pDataObject->pTabPage = (pDataObject->fnCreatePage)(aParent, CreateInputItemSet(pDataObject->sId));
        pDataObject->pTabPage->SetDialogController(this);
        OUString sConfigId = OStringToOUString(pDataObject->pTabPage->GetConfigId(), RTL_TEXTENCODING_UTF8);
            pDataObject->xTabPage = (pDataObject->fnCreatePage)(aParent, CreateInputItemSet(pDataObject->sId));
        pDataObject->xTabPage->SetDialogController(this);
        OUString sConfigId = OStringToOUString(pDataObject->xTabPage->GetConfigId(), RTL_TEXTENCODING_UTF8);
        SvtViewOptions aPageOpt(EViewType::TabPage, sConfigId);
        OUString sUserData;
        Any aUserItem = aPageOpt.GetUserItem(USERITEM_NAME);
        OUString aTemp;
        if ( aUserItem >>= aTemp )
            sUserData = aTemp;
        pDataObject->pTabPage->SetUserData(sUserData);
        pDataObject->xTabPage->SetUserData(sUserData);

        PageCreated(pDataObject->sId, *pDataObject->pTabPage);
        pDataObject->pTabPage->Reset(m_pSet.get());
        PageCreated(pDataObject->sId, *pDataObject->xTabPage);
        pDataObject->xTabPage->Reset(m_pSet.get());
    }
}

@@ -946,11 +931,11 @@ void SfxTabDialogController::setPreviewsToSamePlace()
    std::vector<std::unique_ptr<weld::Widget>> aGrids;
    for (auto pDataObject : m_pImpl->aData)
    {
        if (!pDataObject->pTabPage)
        if (!pDataObject->xTabPage)
            continue;
        if (!pDataObject->pTabPage->m_xBuilder)
        if (!pDataObject->xTabPage->m_xBuilder)
            continue;
        std::unique_ptr<weld::Widget> pGrid = pDataObject->pTabPage->m_xBuilder->weld_widget("maingrid");
        std::unique_ptr<weld::Widget> pGrid = pDataObject->xTabPage->m_xBuilder->weld_widget("maingrid");
        if (!pGrid)
            continue;
        aGrids.emplace_back(std::move(pGrid));
@@ -980,20 +965,20 @@ void SfxTabDialogController::RemoveTabPage(const OString& rId)

    if ( pDataObject )
    {
        if ( pDataObject->pTabPage )
        if ( pDataObject->xTabPage )
        {
            pDataObject->pTabPage->FillUserData();
            OUString aPageData( pDataObject->pTabPage->GetUserData() );
            pDataObject->xTabPage->FillUserData();
            OUString aPageData( pDataObject->xTabPage->GetUserData() );
            if ( !aPageData.isEmpty() )
            {
                // save settings of this page (user data)
                OUString sConfigId = OStringToOUString(pDataObject->pTabPage->GetConfigId(),
                OUString sConfigId = OStringToOUString(pDataObject->xTabPage->GetConfigId(),
                    RTL_TEXTENCODING_UTF8);
                SvtViewOptions aPageOpt(EViewType::TabPage, sConfigId);
                aPageOpt.SetUserItem( USERITEM_NAME, makeAny( aPageData ) );
            }

            pDataObject->pTabPage.disposeAndClear();
            pDataObject->xTabPage.reset();
        }

        delete pDataObject;
@@ -1111,7 +1096,7 @@ SfxTabPage* SfxTabDialogController::GetTabPage(const OString& rPageId) const
{
    Data_Impl* pDataObject = Find(m_pImpl->aData, rPageId);
    if (pDataObject)
        return pDataObject->pTabPage;
        return pDataObject->xTabPage.get();
    return nullptr;
}

@@ -1132,9 +1117,9 @@ bool SfxTabDialogController::Apply()
        GetInputSetImpl()->Put(*GetOutputItemSet());
        for (auto pDataObject : m_pImpl->aData)
        {
            if (!pDataObject->pTabPage)
            if (!pDataObject->xTabPage)
                continue;
            pDataObject->pTabPage->ChangesApplied();
            pDataObject->xTabPage->ChangesApplied();
        }
    }
    return bApplied;
diff --git a/sfx2/source/inc/documentfontsdialog.hxx b/sfx2/source/inc/documentfontsdialog.hxx
index 32ca1b5..c9de2b7 100644
--- a/sfx2/source/inc/documentfontsdialog.hxx
+++ b/sfx2/source/inc/documentfontsdialog.hxx
@@ -29,7 +29,7 @@ class SfxDocumentFontsPage: public SfxTabPage
public:
    SfxDocumentFontsPage(TabPageParent parent, const SfxItemSet& set);
    virtual ~SfxDocumentFontsPage() override;
    static VclPtr<SfxTabPage> Create(TabPageParent parent, const SfxItemSet* set);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent parent, const SfxItemSet* set);
protected:
    virtual bool FillItemSet( SfxItemSet* set ) override;
    virtual void Reset( const SfxItemSet* set ) override;
diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx
index f7b2393..802e6f0 100644
--- a/sfx2/source/view/printer.cxx
+++ b/sfx2/source/view/printer.cxx
@@ -171,34 +171,31 @@ SfxPrintOptionsDialog::SfxPrintOptionsDialog(weld::Window *pParent,
    , pOptions(pSet->Clone())
    , m_xHelpBtn(m_xBuilder->weld_widget("help"))
    , m_xContainer(m_xDialog->weld_content_area())
    , m_xPage(pViewShell->CreatePrintOptionsPage(TabPageParent(m_xContainer.get(), this), *pOptions)) // Insert TabPage
{
    // Insert TabPage
    pPage.reset(pViewShell->CreatePrintOptionsPage(TabPageParent(m_xContainer.get(), this), *pOptions));
    DBG_ASSERT( pPage, "CreatePrintOptions != SFX_VIEW_HAS_PRINTOPTIONS" );
    if( pPage )
    DBG_ASSERT( m_xPage, "CreatePrintOptions != SFX_VIEW_HAS_PRINTOPTIONS" );
    if (m_xPage)
    {
        pPage->Reset( pOptions.get() );
        m_xDialog->set_help_id(pPage->GetHelpId());
        m_xPage->Reset( pOptions.get() );
        m_xDialog->set_help_id(m_xPage->GetHelpId());
    }
}


SfxPrintOptionsDialog::~SfxPrintOptionsDialog()
{
    pPage.disposeAndClear();
}

short SfxPrintOptionsDialog::run()
{
    if (!pPage)
    if (!m_xPage)
        return RET_CANCEL;

    short nRet = GenericDialogController::run();

    if (nRet == RET_OK)
        pPage->FillItemSet( pOptions.get() );
        m_xPage->FillItemSet( pOptions.get() );
    else
        pPage->Reset( pOptions.get() );
        m_xPage->Reset( pOptions.get() );
    return nRet;
}

diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 9be92b2..46a6842 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -900,13 +900,9 @@ sal_uInt16 SfxViewShell::SetPrinter( SfxPrinter* /*pNewPrinter*/, SfxPrinterChan
    return 0;
}

VclPtr<SfxTabPage> SfxViewShell::CreatePrintOptionsPage
(
    TabPageParent /*pParent*/,
    const SfxItemSet&   /*rOptions*/
)
std::unique_ptr<SfxTabPage> SfxViewShell::CreatePrintOptionsPage(TabPageParent /*pParent*/, const SfxItemSet& /*rOptions*/)
{
    return VclPtr<SfxTabPage>();
    return nullptr;
}

bool SfxViewShell::HasPrintOptionsPage() const
diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx
index 713ecb5..0c6c6a9 100644
--- a/starmath/inc/dialog.hxx
+++ b/starmath/inc/dialog.hxx
@@ -57,7 +57,7 @@ class SmPrintOptionsTabPage : public SfxTabPage
    virtual void    Reset(const SfxItemSet* rSet) override;

public:
    static VclPtr<SfxTabPage> Create(TabPageParent pWindow, const SfxItemSet &rSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pWindow, const SfxItemSet &rSet);

    SmPrintOptionsTabPage(TabPageParent pPage, const SfxItemSet &rOptions);
    virtual ~SmPrintOptionsTabPage() override;
diff --git a/starmath/inc/smmod.hxx b/starmath/inc/smmod.hxx
index 8c33f5a..8e3759e 100644
--- a/starmath/inc/smmod.hxx
+++ b/starmath/inc/smmod.hxx
@@ -97,7 +97,7 @@ public:
    //virtual methods for options dialog
    virtual std::unique_ptr<SfxItemSet> CreateItemSet( sal_uInt16 nId ) override;
    virtual void         ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) override;
    virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet ) override;
    virtual std::unique_ptr<SfxTabPage> CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet ) override;
};

#define SM_MOD() ( static_cast<SmModule*>(SfxApplication::GetModule(SfxToolsModule::Math)) )
diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx
index fb27546..62068e5 100644
--- a/starmath/inc/view.hxx
+++ b/starmath/inc/view.hxx
@@ -249,8 +249,8 @@ protected:
    void InsertFrom(SfxMedium &rMedium);

    virtual bool HasPrintOptionsPage() const override;
    virtual VclPtr<SfxTabPage> CreatePrintOptionsPage(TabPageParent pParent,
                                                      const SfxItemSet &rOptions) override;
    virtual std::unique_ptr<SfxTabPage> CreatePrintOptionsPage(TabPageParent pParent,
                                                               const SfxItemSet &rOptions) override;
    virtual void Deactivate(bool IsMDIActivate) override;
    virtual void Activate(bool IsMDIActivate) override;
    virtual void InnerResizePixel(const Point &rOfs, const Size  &rSize, bool inplaceEditModeChange) override;
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 5e236f64..6be0c38 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -224,9 +224,9 @@ void SmPrintOptionsTabPage::Reset(const SfxItemSet* rSet)
    m_xAutoCloseBrackets->set_active(static_cast<const SfxBoolItem &>(rSet->Get(GetWhich(SID_AUTO_CLOSE_BRACKETS))).GetValue());
}

VclPtr<SfxTabPage> SmPrintOptionsTabPage::Create(TabPageParent pParent, const SfxItemSet& rSet)
std::unique_ptr<SfxTabPage> SmPrintOptionsTabPage::Create(TabPageParent pParent, const SfxItemSet& rSet)
{
    return VclPtr<SmPrintOptionsTabPage>::Create(pParent, rSet).get();
    return std::make_unique<SmPrintOptionsTabPage>(pParent, rSet);
}

void SmShowFont::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& /*rRect*/)
diff --git a/starmath/source/smmod.cxx b/starmath/source/smmod.cxx
index 93a0ca2..6429e4a 100644
--- a/starmath/source/smmod.cxx
+++ b/starmath/source/smmod.cxx
@@ -224,13 +224,12 @@ void SmModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
    }
}

VclPtr<SfxTabPage> SmModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet )
std::unique_ptr<SfxTabPage> SmModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet )
{
    VclPtr<SfxTabPage> pRet;
    std::unique_ptr<SfxTabPage> xRet;
    if (nId == SID_SM_TP_PRINTOPTIONS)
        pRet = SmPrintOptionsTabPage::Create(pParent, rSet);
    return pRet;

        xRet = SmPrintOptionsTabPage::Create(pParent, rSet);
    return xRet;
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 68a4368..b0a020f 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -1266,7 +1266,7 @@ bool SmViewShell::HasPrintOptionsPage() const
    return true;
}

VclPtr<SfxTabPage> SmViewShell::CreatePrintOptionsPage(TabPageParent pParent,
std::unique_ptr<SfxTabPage> SmViewShell::CreatePrintOptionsPage(TabPageParent pParent,
                                                       const SfxItemSet &rOptions)
{
    return SmPrintOptionsTabPage::Create(pParent, rOptions);
diff --git a/svtools/source/uno/wizard/wizardpagecontroller.cxx b/svtools/source/uno/wizard/wizardpagecontroller.cxx
index 35f3d17..3faf682 100644
--- a/svtools/source/uno/wizard/wizardpagecontroller.cxx
+++ b/svtools/source/uno/wizard/wizardpagecontroller.cxx
@@ -45,7 +45,7 @@ namespace svt { namespace uno
    //= WizardPageController


    WizardPageController::WizardPageController( TabPageParent aParent, const Reference< XWizardController >& i_rController,
    WizardPageController::WizardPageController(weld::Container* pParent, const Reference< XWizardController >& i_rController,
            const sal_Int16 i_nPageId )
        :m_xController( i_rController )
        ,m_xWizardPage()
@@ -54,14 +54,10 @@ namespace svt { namespace uno
        try
        {
            // Plug a toplevel SalFrame into the native page which can host our awt widgetry
            m_xWizardPage.set(m_xController->createPage(aParent.pPage->CreateChildFrame(), i_nPageId), UNO_SET_THROW);
            m_xWizardPage.set(m_xController->createPage(pParent->CreateChildFrame(), i_nPageId), UNO_SET_THROW);

            Reference< XWindow > xPageWindow( m_xWizardPage->getWindow(), UNO_SET_THROW );
            Reference< XWindow > xPageWindow(m_xWizardPage->getWindow(), UNO_SET_THROW);
            xPageWindow->setVisible( true );

            TabPage* pTabPage( getTabPage() );
            if ( pTabPage )
                pTabPage->SetStyle( pTabPage->GetStyle() | WB_CHILDDLGCTRL | WB_DIALOGCONTROL );
        }
        catch( const Exception& )
        {
@@ -69,7 +65,6 @@ namespace svt { namespace uno
        }
    }


    WizardPageController::~WizardPageController()
    {
        try
@@ -83,34 +78,6 @@ namespace svt { namespace uno
        }
    }


    TabPage* WizardPageController::getTabPage() const
    {
        ENSURE_OR_RETURN( m_xWizardPage.is(), "WizardPageController::getTabPage: no external wizard page!", nullptr );
        try
        {
            Reference< XWindow > xPageWindow( m_xWizardPage->getWindow(), UNO_SET_THROW );
            VclPtr<vcl::Window> pPageWindow = VCLUnoHelper::GetWindow( xPageWindow );
            if ( pPageWindow )
            {
                // windows created via the XContainerWindowProvider might be controls, not real windows, so resolve
                // that one indirection
                const Reference< XControl > xPageControl( m_xWizardPage->getWindow(), UNO_QUERY_THROW );
                xPageWindow.set( xPageControl->getPeer(), UNO_QUERY_THROW );
                pPageWindow = VCLUnoHelper::GetWindow( xPageWindow );
            }

            OSL_ENSURE( pPageWindow, "WizardPageController::getTabPage: unable to find the Window implementation for the page's window!" );
            return dynamic_cast< TabPage* >( pPageWindow.get() );
        }
        catch( const Exception& )
        {
            DBG_UNHANDLED_EXCEPTION("svtools.uno");
        }
        return nullptr;
    }


    void WizardPageController::initializePage()
    {
        if ( !m_xWizardPage.is() )
diff --git a/svtools/source/uno/wizard/wizardpagecontroller.hxx b/svtools/source/uno/wizard/wizardpagecontroller.hxx
index 0ce9f47..1a01610 100644
--- a/svtools/source/uno/wizard/wizardpagecontroller.hxx
+++ b/svtools/source/uno/wizard/wizardpagecontroller.hxx
@@ -21,10 +21,8 @@
#define INCLUDED_SVTOOLS_SOURCE_UNO_WIZARD_WIZARDPAGECONTROLLER_HXX

#include <vcl/wizardmachine.hxx>

#include <com/sun/star/ui/dialogs/XWizardController.hpp>


namespace svt { namespace uno
{

@@ -38,7 +36,7 @@ namespace svt { namespace uno
    {
    public:
        WizardPageController(
            TabPageParent aParent,
            weld::Container* pParent,
            const css::uno::Reference< css::ui::dialogs::XWizardController >& i_rController,
            const sal_Int16 i_nPageId
        );
@@ -51,7 +49,6 @@ namespace svt { namespace uno

        const css::uno::Reference< css::ui::dialogs::XWizardPage >&
                            getWizardPage() const { return m_xWizardPage; }
        TabPage*            getTabPage() const;

    private:
        const css::uno::Reference< css::ui::dialogs::XWizardController >  m_xController;
diff --git a/svtools/source/uno/wizard/wizardshell.cxx b/svtools/source/uno/wizard/wizardshell.cxx
index 6cca747..6d72a12 100644
--- a/svtools/source/uno/wizard/wizardshell.cxx
+++ b/svtools/source/uno/wizard/wizardshell.cxx
@@ -143,7 +143,7 @@ namespace svt { namespace uno
    }


    PWizardPageController WizardShell::impl_getController( TabPage* i_pPage ) const
    PWizardPageController WizardShell::impl_getController(BuilderPage* i_pPage) const
    {
        Page2ControllerMap::const_iterator pos = m_aPageControllers.find( i_pPage );
        ENSURE_OR_RETURN( pos != m_aPageControllers.end(), "WizardShell::impl_getController: no controller for this page!", PWizardPageController() );
@@ -161,14 +161,27 @@ namespace svt { namespace uno
        return pController->getWizardPage();
    }


    void WizardShell::enablePage( const sal_Int16 i_nPageID, const bool i_bEnable )
    {
        enableState( impl_pageIdToState( i_nPageID ), i_bEnable );
    }

    namespace
    {
        class EmptyPage : public BuilderPage
        {
        public:
            EmptyPage(weld::Widget* pParent, weld::DialogController* pController)
                : BuilderPage(pParent, pController, "svt/ui/emptypage.ui", "EmptyPage")
            {
                m_xContainer->set_size_request(m_xContainer->get_approximate_digit_width() * 70,
                                               m_xContainer->get_text_height() * 45);
            }
            weld::Container* GetContainer() const { return m_xContainer.get(); }
        };
    }

    VclPtr<TabPage> WizardShell::createPage( WizardState i_nState )
    std::unique_ptr<BuilderPage> WizardShell::createPage( WizardState i_nState )
    {
        ENSURE_OR_RETURN( m_xController.is(), "WizardShell::createPage: no WizardController!", nullptr );

@@ -176,29 +189,20 @@ namespace svt { namespace uno

        OString sIdent(OString::number(nPageId));
        weld::Container* pPageContainer = m_xAssistant->append_page(sIdent);
        // TODO eventually pass DialogController as distinct argument instead of bundling into TabPageParent
        TabPageParent aParent(pPageContainer, this);

        std::shared_ptr< WizardPageController > pController(new WizardPageController(aParent, m_xController, nPageId));
        VclPtr<TabPage> pPage = pController->getTabPage();
        OSL_ENSURE( pPage, "WizardShell::createPage: illegal tab page!" );
        if (!pPage)
        {
            // fallback for ill-behaved clients: empty page
            pPage = VclPtr<vcl::OWizardPage>::Create(aParent, "svt/ui/emptypage.ui", "EmptyPage");
            pPage->SetSizePixel(pPage->LogicToPixel(Size(280, 185), MapMode(MapUnit::MapAppFont)));
        }
        auto xPage = std::make_unique<EmptyPage>(pPageContainer, this);
        std::shared_ptr< WizardPageController > pController(new WizardPageController(xPage->GetContainer(), m_xController, nPageId));

        m_aPageControllers[ pPage ] = pController;
        return pPage;
        m_aPageControllers[xPage.get()] = pController;

        return xPage;
    }

    vcl::IWizardPageController* WizardShell::getPageController( TabPage* i_pCurrentPage ) const
    vcl::IWizardPageController* WizardShell::getPageController(BuilderPage* i_pCurrentPage) const
    {
        return impl_getController( i_pCurrentPage ).get();
    }


    OUString WizardShell::getStateDisplayName( WizardState i_nState ) const
    {
        try
diff --git a/svtools/source/uno/wizard/wizardshell.hxx b/svtools/source/uno/wizard/wizardshell.hxx
index 94ad406d..391df0f 100644
--- a/svtools/source/uno/wizard/wizardshell.hxx
+++ b/svtools/source/uno/wizard/wizardshell.hxx
@@ -53,14 +53,13 @@ namespace svt { namespace uno
        virtual short   run() override;

        // OWizardMachine overridables
        virtual VclPtr<TabPage> createPage( WizardState i_nState ) override;
        virtual std::unique_ptr<BuilderPage> createPage( WizardState i_nState ) override;
        virtual void        enterState( WizardState i_nState ) override;
        virtual bool        leaveState( WizardState i_nState ) override;
        virtual OUString    getStateDisplayName( WizardState i_nState ) const override;
        virtual bool        canAdvance() const override;
        virtual bool        onFinish() override;
        virtual vcl::IWizardPageController*
                            getPageController( TabPage* _pCurrentPage ) const override;
        virtual vcl::IWizardPageController* getPageController(BuilderPage* pCurrentPage) const override;

        static sal_Int16 convertCommitReasonToTravelType( const CommitPageReason i_eReason );

@@ -107,7 +106,7 @@ namespace svt { namespace uno
            return static_cast<WizardState>(i_nPageId - m_nFirstPageID);
        }

        PWizardPageController impl_getController( TabPage* i_pPage ) const;
        PWizardPageController impl_getController(BuilderPage* i_pPage) const;

        // prevent outside access to some base class members
        using WizardShell_Base::skip;
@@ -117,7 +116,7 @@ namespace svt { namespace uno
        using WizardShell_Base::activatePath;

    private:
        typedef ::std::map< VclPtr<TabPage>, PWizardPageController > Page2ControllerMap;
        typedef std::map<BuilderPage*, PWizardPageController> Page2ControllerMap;

        const css::uno::Reference< css::ui::dialogs::XWizardController >  m_xController;
        const sal_Int16                                                                             m_nFirstPageID;
diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx
index e4c622a..108a37d 100644
--- a/svx/source/dialog/hdft.cxx
+++ b/svx/source/dialog/hdft.cxx
@@ -108,14 +108,14 @@ namespace svx {
    }
}

VclPtr<SfxTabPage> SvxHeaderPage::Create( TabPageParent pParent, const SfxItemSet* rSet )
std::unique_ptr<SfxTabPage> SvxHeaderPage::Create( TabPageParent pParent, const SfxItemSet* rSet )
{
    return VclPtr<SvxHeaderPage>::Create( pParent, *rSet );
    return std::make_unique<SvxHeaderPage>( pParent, *rSet );
}

VclPtr<SfxTabPage> SvxFooterPage::Create( TabPageParent pParent, const SfxItemSet* rSet )
std::unique_ptr<SfxTabPage> SvxFooterPage::Create( TabPageParent pParent, const SfxItemSet* rSet )
{
    return VclPtr<SvxFooterPage>::Create( pParent, *rSet );
    return std::make_unique<SvxFooterPage>( pParent, *rSet );
}

SvxHeaderPage::SvxHeaderPage(TabPageParent pParent, const SfxItemSet& rAttr)
@@ -493,12 +493,12 @@ void SvxHFPage::TurnOn(const weld::ToggleButton* pBox)
            short nResult;
            if (nId == SID_ATTR_PAGE_HEADERSET)
            {
                DeleteHeaderDialog aDlg(GetFrameWeld());
                DeleteHeaderDialog aDlg(GetDialogFrameWeld());
                nResult = aDlg.run();
            }
            else
            {
                DeleteFooterDialog aDlg(GetFrameWeld());
                DeleteFooterDialog aDlg(GetDialogFrameWeld());
                nResult = aDlg.run();
            }
            bDelete = nResult == RET_YES;
diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx
index e5a8ea6..836dbdbf 100644
--- a/svx/source/dialog/optgrid.cxx
+++ b/svx/source/dialog/optgrid.cxx
@@ -144,12 +144,11 @@ SvxGridTabPage::SvxGridTabPage(TabPageParent pParent, const SfxItemSet& rCoreSet

SvxGridTabPage::~SvxGridTabPage()
{
    disposeOnce();
}

VclPtr<SfxTabPage> SvxGridTabPage::Create(TabPageParent pParent, const SfxItemSet& rAttrSet)
std::unique_ptr<SfxTabPage> SvxGridTabPage::Create(TabPageParent pParent, const SfxItemSet& rAttrSet)
{
    return VclPtr<SvxGridTabPage>::Create(pParent, rAttrSet);
    return std::make_unique<SvxGridTabPage>(pParent, rAttrSet);
}

bool SvxGridTabPage::FillItemSet( SfxItemSet* rCoreSet )
diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx
index 4df8a72..fe84e9c 100644
--- a/svx/source/tbxctrls/grafctrl.cxx
+++ b/svx/source/tbxctrls/grafctrl.cxx
@@ -713,10 +713,9 @@ void SvxGrafAttrHelper::ExecuteGrafAttr( SfxRequest& rReq, SdrView& rView )
                    SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
                    ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_GRFCROP );
                    TabPageParent pPageParent(aCropDialog.get_content_area(), &aCropDialog);
                    VclPtr<SfxTabPage> xTabPage = (*fnCreatePage)(pPageParent, &aCropDlgAttr);

                    xTabPage->SetText(aCropStr);
                    aCropDialog.SetTabPage(xTabPage);
                    std::unique_ptr<SfxTabPage> xTabPage = (*fnCreatePage)(pPageParent, &aCropDlgAttr);
                    xTabPage->SetPageTitle(aCropStr);
                    aCropDialog.SetTabPage(std::move(xTabPage));

                    if (aCropDialog.run() == RET_OK)
                    {
diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx
index 5d96a31..0176797 100644
--- a/sw/inc/swmodule.hxx
+++ b/sw/inc/swmodule.hxx
@@ -229,7 +229,7 @@ public:
    // Virtual methods for options dialog.
    virtual std::unique_ptr<SfxItemSet> CreateItemSet( sal_uInt16 nId ) override;
    virtual void         ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) override;
    virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet ) override;
    virtual std::unique_ptr<SfxTabPage> CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet ) override;
    virtual std::unique_ptr<SfxStyleFamilies> CreateStyleFamilies() override;

    // Pool is created here and set at SfxShell.
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index dd42fe4..83412953 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -630,7 +630,7 @@ public:
    // methods for printing
    SAL_DLLPRIVATE virtual   SfxPrinter*     GetPrinter( bool bCreate = false ) override;
    SAL_DLLPRIVATE virtual bool  HasPrintOptionsPage() const override;
    SAL_DLLPRIVATE virtual VclPtr<SfxTabPage> CreatePrintOptionsPage(TabPageParent pParent,
    SAL_DLLPRIVATE virtual std::unique_ptr<SfxTabPage> CreatePrintOptionsPage(TabPageParent pParent,
                                                    const SfxItemSet& rSet) override;
    static SvxSearchItem* GetSearchItem() { return s_pSrchItem; }
    /// See SfxViewShell::getPart().
@@ -690,7 +690,7 @@ inline const SwDocShell *SwView::GetDocShell() const
    return const_cast<SwView*>(this)->GetDocShell();
}

VclPtr<SfxTabPage> CreatePrintOptionsPage(TabPageParent pParent,
std::unique_ptr<SfxTabPage> CreatePrintOptionsPage(TabPageParent pParent,
                                          const SfxItemSet &rOptions,
                                          bool bPreview);

diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx
index 06b3ced..68eba76 100644
--- a/sw/source/ui/chrdlg/chardlg.cxx
+++ b/sw/source/ui/chrdlg/chardlg.cxx
@@ -190,13 +190,7 @@ SwCharURLPage::SwCharURLPage(TabPageParent pParent, const SfxItemSet& rCoreSet)

SwCharURLPage::~SwCharURLPage()
{
    disposeOnce();
}

void SwCharURLPage::dispose()
{
    pINetItem.reset();
    SfxTabPage::dispose();
}

void SwCharURLPage::Reset(const SfxItemSet* rSet)
@@ -290,15 +284,15 @@ bool SwCharURLPage::FillItemSet(SfxItemSet* rSet)
    return bModified;
}

VclPtr<SfxTabPage> SwCharURLPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
std::unique_ptr<SfxTabPage> SwCharURLPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
{
    return VclPtr<SwCharURLPage>::Create(pParent, *rAttrSet);
    return std::make_unique<SwCharURLPage>(pParent, *rAttrSet);
}

IMPL_LINK_NOARG(SwCharURLPage, InsertFileHdl, weld::Button&, void)
{
    FileDialogHelper aDlgHelper(TemplateDescription::FILEOPEN_SIMPLE,
                                FileDialogFlags::NONE, GetFrameWeld());
                                FileDialogFlags::NONE, GetDialogFrameWeld());
    if( aDlgHelper.Execute() == ERRCODE_NONE )
    {
        const Reference<XFilePicker3>& xFP = aDlgHelper.GetFilePicker();
diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx
index 5cd01dd..82ab519 100644
--- a/sw/source/ui/chrdlg/drpcps.cxx
+++ b/sw/source/ui/chrdlg/drpcps.cxx
@@ -454,9 +454,9 @@ SwDropCapsDlg::SwDropCapsDlg(weld::Window *pParent, const SfxItemSet &rSet)
    : SfxSingleTabDialogController(pParent, &rSet)
{
    TabPageParent pPageParent(get_content_area(), this);
    VclPtr<SwDropCapsPage> xNewPage(static_cast<SwDropCapsPage*>(SwDropCapsPage::Create(pPageParent, &rSet).get()));
    xNewPage->SetFormat(false);
    SetTabPage(xNewPage);
    auto xNewPage(SwDropCapsPage::Create(pPageParent, &rSet));
    static_cast<SwDropCapsPage*>(xNewPage.get())->SetFormat(false);
    SetTabPage(std::move(xNewPage));
}

SwDropCapsPage::SwDropCapsPage(TabPageParent pParent, const SfxItemSet &rSet)
@@ -520,10 +520,9 @@ DeactivateRC SwDropCapsPage::DeactivatePage(SfxItemSet * _pSet)
    return DeactivateRC::LeavePage;
}

VclPtr<SfxTabPage> SwDropCapsPage::Create(TabPageParent pParent,
                                          const SfxItemSet *rSet)
std::unique_ptr<SfxTabPage> SwDropCapsPage::Create(TabPageParent pParent, const SfxItemSet *rSet)
{
    return VclPtr<SwDropCapsPage>::Create(pParent, *rSet);
    return std::make_unique<SwDropCapsPage>(pParent, *rSet);
}

bool  SwDropCapsPage::FillItemSet(SfxItemSet *rSet)
diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx
index 09a5e3c..83ed68c 100644
--- a/sw/source/ui/chrdlg/numpara.cxx
+++ b/sw/source/ui/chrdlg/numpara.cxx
@@ -98,9 +98,9 @@ SwParagraphNumTabPage::~SwParagraphNumTabPage()
{
}

VclPtr<SfxTabPage> SwParagraphNumTabPage::Create(TabPageParent pParent, const SfxItemSet* rSet)
std::unique_ptr<SfxTabPage> SwParagraphNumTabPage::Create(TabPageParent pParent, const SfxItemSet* rSet)
{
    return VclPtr<SwParagraphNumTabPage>::Create(pParent, *rSet);
    return std::make_unique<SwParagraphNumTabPage>(pParent, *rSet);
}

bool SwParagraphNumTabPage::FillItemSet( SfxItemSet* rSet )
diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx
index e3cfd14..36bac20 100644
--- a/sw/source/ui/chrdlg/swuiccoll.cxx
+++ b/sw/source/ui/chrdlg/swuiccoll.cxx
@@ -101,7 +101,6 @@ SwCondCollPage::SwCondCollPage(TabPageParent pParent, const SfxItemSet &rSet)

SwCondCollPage::~SwCondCollPage()
{
    disposeOnce();
}

DeactivateRC SwCondCollPage::DeactivatePage(SfxItemSet * _pSet)
@@ -112,9 +111,9 @@ DeactivateRC SwCondCollPage::DeactivatePage(SfxItemSet * _pSet)
    return DeactivateRC::LeavePage;
}

VclPtr<SfxTabPage> SwCondCollPage::Create(TabPageParent pParent, const SfxItemSet *rSet)
std::unique_ptr<SfxTabPage> SwCondCollPage::Create(TabPageParent pParent, const SfxItemSet *rSet)
{
    return VclPtr<SwCondCollPage>::Create(pParent, *rSet);
    return std::make_unique<SwCondCollPage>(pParent, *rSet);
}

bool SwCondCollPage::FillItemSet(SfxItemSet *rSet)
diff --git a/sw/source/ui/chrdlg/tblnumfm.cxx b/sw/source/ui/chrdlg/tblnumfm.cxx
index e672261..cb22795 100644
--- a/sw/source/ui/chrdlg/tblnumfm.cxx
+++ b/sw/source/ui/chrdlg/tblnumfm.cxx
@@ -36,11 +36,11 @@ SwNumFormatDlg::SwNumFormatDlg(weld::Widget* pParent, const SfxItemSet& rSet)
    if ( fnCreatePage )
    {
        TabPageParent pPageParent(get_content_area(), this);
        VclPtr<SfxTabPage> xNewPage = (*fnCreatePage)(pPageParent, &rSet);
        std::unique_ptr<SfxTabPage> xNewPage = (*fnCreatePage)(pPageParent, &rSet);
        SfxAllItemSet aSet(*(rSet.GetPool()));
        aSet.Put(xNewPage->GetItemSet().Get( SID_ATTR_NUMBERFORMAT_INFO));
        xNewPage->PageCreated(aSet);
        SetTabPage(xNewPage);
        SetTabPage(std::move(xNewPage));
    }
}

diff --git a/sw/source/ui/config/mailconfigpage.cxx b/sw/source/ui/config/mailconfigpage.cxx
index a4c8a1f..eff36f3 100644
--- a/sw/source/ui/config/mailconfigpage.cxx
+++ b/sw/source/ui/config/mailconfigpage.cxx
@@ -47,7 +47,7 @@ class SwTestAccountSettingsDialog : public SfxDialogController
    OUString            m_sErrorServer;
    bool                m_bStop;

    VclPtr<SwMailConfigPage>   m_pParent;
    SwMailConfigPage*   m_pParent;

    std::unique_ptr<weld::Button> m_xStopPB;
    std::unique_ptr<weld::TextView> m_xErrorsED;
@@ -125,18 +125,12 @@ SwMailConfigPage::SwMailConfigPage(TabPageParent pParent, const SfxItemSet& rSet

SwMailConfigPage::~SwMailConfigPage()
{
    disposeOnce();
}

void SwMailConfigPage::dispose()
{
    m_pConfigItem.reset();
    SfxTabPage::dispose();
}

VclPtr<SfxTabPage> SwMailConfigPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
std::unique_ptr<SfxTabPage> SwMailConfigPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
{
    return VclPtr<SwMailConfigPage>::Create(pParent, *rAttrSet);
    return std::make_unique<SwMailConfigPage>(pParent, *rAttrSet);
}

bool SwMailConfigPage::FillItemSet( SfxItemSet* /*rSet*/ )
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx
index 3eb50d8..4dfac04 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -340,9 +340,9 @@ void SwCompatibilityOptPage::WriteOptions()
        m_aConfigItem.AppendItem(rItem);
}

VclPtr<SfxTabPage> SwCompatibilityOptPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet )
std::unique_ptr<SfxTabPage> SwCompatibilityOptPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
{
    return VclPtr<SwCompatibilityOptPage>::Create( pParent, *rAttrSet );
    return std::make_unique<SwCompatibilityOptPage>(pParent, *rAttrSet);
}

bool SwCompatibilityOptPage::FillItemSet( SfxItemSet*  )
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index 0af4778..59bcb5c 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -145,10 +145,10 @@ SwLoadOptPage::~SwLoadOptPage()
{
}

VclPtr<SfxTabPage> SwLoadOptPage::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> SwLoadOptPage::Create( TabPageParent pParent,
                                          const SfxItemSet* rAttrSet )
{
    return VclPtr<SwLoadOptPage>::Create(pParent, *rAttrSet );
    return std::make_unique<SwLoadOptPage>(pParent, *rAttrSet );
}

IMPL_LINK_NOARG(SwLoadOptPage, StandardizedPageCountCheckHdl, weld::Button&, void)
@@ -540,21 +540,15 @@ SwCaptionOptPage::SwCaptionOptPage(TabPageParent pParent, const SfxItemSet& rSet

SwCaptionOptPage::~SwCaptionOptPage()
{
    disposeOnce();
}

void SwCaptionOptPage::dispose()
{
    DelUserData();
    pMgr.reset();
    m_xPreview.reset();
    SfxTabPage::dispose();
}

VclPtr<SfxTabPage> SwCaptionOptPage::Create(TabPageParent pParent,
std::unique_ptr<SfxTabPage> SwCaptionOptPage::Create(TabPageParent pParent,
                                            const SfxItemSet* rAttrSet)
{
    return VclPtr<SwCaptionOptPage>::Create(pParent, *rAttrSet);
    return std::make_unique<SwCaptionOptPage>(pParent, *rAttrSet);
}

bool SwCaptionOptPage::FillItemSet( SfxItemSet* )
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 065af21..8f5a0ed 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -170,10 +170,10 @@ SwContentOptPage::~SwContentOptPage()
{
}

VclPtr<SfxTabPage> SwContentOptPage::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> SwContentOptPage::Create( TabPageParent pParent,
                                             const SfxItemSet* rAttrSet)
{
    return VclPtr<SwContentOptPage>::Create(pParent, *rAttrSet);
    return std::make_unique<SwContentOptPage>(pParent, *rAttrSet);
}

static void lcl_SelectMetricLB(weld::ComboBox& rMetric, sal_uInt16 nSID, const SfxItemSet& rSet)
@@ -350,10 +350,10 @@ void SwAddPrinterTabPage::SetPreview(bool bPrev)
    m_xPagesFrame->set_sensitive(!bPreview);
}

VclPtr<SfxTabPage> SwAddPrinterTabPage::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> SwAddPrinterTabPage::Create( TabPageParent pParent,
                                                const SfxItemSet* rAttrSet )
{
    return VclPtr<SwAddPrinterTabPage>::Create(pParent, *rAttrSet);
    return std::make_unique<SwAddPrinterTabPage>(pParent, *rAttrSet);
}

bool    SwAddPrinterTabPage::FillItemSet( SfxItemSet* rCoreSet )
@@ -544,11 +544,6 @@ SwStdFontTabPage::SwStdFontTabPage(TabPageParent pParent, const SfxItemSet& rSet

SwStdFontTabPage::~SwStdFontTabPage()
{
    disposeOnce();
}

void SwStdFontTabPage::dispose()
{
    m_xIndexHeightLB.reset();
    m_xLabelHeightLB.reset();
    m_xListHeightLB.reset();
@@ -559,13 +554,12 @@ void SwStdFontTabPage::dispose()
        m_pPrt.disposeAndClear();
    else
        m_pPrt.clear();
    SfxTabPage::dispose();
}

VclPtr<SfxTabPage> SwStdFontTabPage::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> SwStdFontTabPage::Create( TabPageParent pParent,
                                             const SfxItemSet* rAttrSet )
{
    return VclPtr<SwStdFontTabPage>::Create(pParent, *rAttrSet);
    return std::make_unique<SwStdFontTabPage>(pParent, *rAttrSet);
}

static void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType,
@@ -1031,10 +1025,10 @@ SwTableOptionsTabPage::~SwTableOptionsTabPage()
{
}

VclPtr<SfxTabPage> SwTableOptionsTabPage::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> SwTableOptionsTabPage::Create( TabPageParent pParent,
                                                  const SfxItemSet* rAttrSet )
{
    return VclPtr<SwTableOptionsTabPage>::Create(pParent, *rAttrSet);
    return std::make_unique<SwTableOptionsTabPage>(pParent, *rAttrSet);
}

bool SwTableOptionsTabPage::FillItemSet( SfxItemSet* )
@@ -1264,9 +1258,9 @@ SwShdwCursorOptionsTabPage::~SwShdwCursorOptionsTabPage()
{
}

VclPtr<SfxTabPage> SwShdwCursorOptionsTabPage::Create( TabPageParent pParent, const SfxItemSet* rSet )
std::unique_ptr<SfxTabPage> SwShdwCursorOptionsTabPage::Create( TabPageParent pParent, const SfxItemSet* rSet )
{
    return VclPtr<SwShdwCursorOptionsTabPage>::Create( pParent, *rSet );
    return std::make_unique<SwShdwCursorOptionsTabPage>(pParent, *rSet );
}

void SwShdwCursorOptionsTabPage::PageCreated( const SfxAllItemSet& aSet )
@@ -1630,11 +1624,6 @@ SwRedlineOptionsTabPage::SwRedlineOptionsTabPage(TabPageParent pParent,

SwRedlineOptionsTabPage::~SwRedlineOptionsTabPage()
{
    disposeOnce();
}

void SwRedlineOptionsTabPage::dispose()
{
    m_xInsertColorLB.reset();
    m_xInsertedPreview.reset();
    m_xInsertedPreviewWN.reset();
@@ -1647,12 +1636,11 @@ void SwRedlineOptionsTabPage::dispose()
    m_xMarkColorLB.reset();
    m_xMarkPreview.reset();
    m_xMarkPreviewWN.reset();
    SfxTabPage::dispose();
}

VclPtr<SfxTabPage> SwRedlineOptionsTabPage::Create( TabPageParent pParent, const SfxItemSet* rSet)
std::unique_ptr<SfxTabPage> SwRedlineOptionsTabPage::Create( TabPageParent pParent, const SfxItemSet* rSet)
{
    return VclPtr<SwRedlineOptionsTabPage>::Create( pParent, *rSet );
    return std::make_unique<SwRedlineOptionsTabPage>(pParent, *rSet );
}

bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet* )
@@ -2038,9 +2026,9 @@ SwCompareOptionsTabPage::~SwCompareOptionsTabPage()
{
}

VclPtr<SfxTabPage> SwCompareOptionsTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet )
std::unique_ptr<SfxTabPage> SwCompareOptionsTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet )
{
    return VclPtr<SwCompareOptionsTabPage>::Create( pParent, *rAttrSet );
    return std::make_unique<SwCompareOptionsTabPage>(pParent, *rAttrSet );
}

bool SwCompareOptionsTabPage::FillItemSet( SfxItemSet* )
@@ -2170,10 +2158,10 @@ SwTestTabPage::~SwTestTabPage()
{
}

VclPtr<SfxTabPage> SwTestTabPage::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> SwTestTabPage::Create( TabPageParent pParent,
                                          const SfxItemSet* rAttrSet )
{
    return VclPtr<SwTestTabPage>::Create(pParent, *rAttrSet);
    return std::make_unique<SwTestTabPage>(pParent, *rAttrSet);
}

bool    SwTestTabPage::FillItemSet( SfxItemSet* rCoreSet )
diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx
index 56b4801..e4d6792 100644
--- a/sw/source/ui/dbui/addresslistdialog.cxx
+++ b/sw/source/ui/dbui/addresslistdialog.cxx
@@ -122,7 +122,7 @@ static OUString lcl_getFlatURL( uno::Reference<beans::XPropertySet> const & xSou
SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent)
    : SfxDialogController(pParent->GetWizard()->getDialog(), "modules/swriter/ui/selectaddressdialog.ui", "SelectAddressDialog")
    , m_bInSelectHdl(false)
    , m_xAddressPage(pParent)
    , m_pAddressPage(pParent)
    , m_xDescriptionFI(m_xBuilder->weld_label("desc"))
    , m_xConnecting(m_xBuilder->weld_label("connecting"))
    , m_xListLB(m_xBuilder->weld_tree_view("sources"))
@@ -161,7 +161,7 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent)
    uno::Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
    m_xDBContext = DatabaseContext::create(xContext);

    SwMailMergeConfigItem& rConfigItem = m_xAddressPage->GetWizard()->GetConfigItem();
    SwMailMergeConfigItem& rConfigItem = m_pAddressPage->GetWizard()->GetConfigItem();
    const SwDBData& rCurrentData = rConfigItem.GetCurrentDBData();

    bool bEnableEdit = false;
@@ -276,7 +276,7 @@ IMPL_LINK_NOARG(SwAddressListDialog, FilterHdl_Impl, weld::Button&, void)

IMPL_LINK_NOARG(SwAddressListDialog, LoadHdl_Impl, weld::Button&, void)
{
    SwView* pView = m_xAddressPage->GetWizard()->GetSwView();
    SwView* pView = m_pAddressPage->GetWizard()->GetSwView();

    const OUString sNewSource = SwDBManager::LoadAndRegisterDataSource(m_xDialog.get(), pView ? pView->GetDocShell() : nullptr);
    if(!sNewSource.isEmpty())
@@ -320,7 +320,7 @@ IMPL_LINK_NOARG(SwAddressListDialog, RemoveHdl_Impl, weld::Button&, void)

IMPL_LINK_NOARG(SwAddressListDialog, CreateHdl_Impl, weld::Button&, void)
{
    SwCreateAddressListDialog aDlg(m_xDialog.get(), /*sInputURL*/OUString(), m_xAddressPage->GetWizard()->GetConfigItem());
    SwCreateAddressListDialog aDlg(m_xDialog.get(), /*sInputURL*/OUString(), m_pAddressPage->GetWizard()->GetConfigItem());
    if (RET_OK == aDlg.run())
    {
        //register the URL a new datasource
@@ -400,7 +400,7 @@ IMPL_LINK_NOARG(SwAddressListDialog, EditHdl_Impl, weld::Button&, void)
    {
        if(pUserData->xResultSet.is())
        {
            SwMailMergeConfigItem& rConfigItem = m_xAddressPage->GetWizard()->GetConfigItem();
            SwMailMergeConfigItem& rConfigItem = m_pAddressPage->GetWizard()->GetConfigItem();
            if(rConfigItem.GetResultSet() != pUserData->xResultSet)
                ::comphelper::disposeComponent( pUserData->xResultSet );
            pUserData->xResultSet = nullptr;
@@ -412,7 +412,7 @@ IMPL_LINK_NOARG(SwAddressListDialog, EditHdl_Impl, weld::Button&, void)
        pUserData->xConnection.clear();
            // will automatically close if it was the las reference
        SwCreateAddressListDialog aDlg(m_xDialog.get(), pUserData->sURL,
                                       m_xAddressPage->GetWizard()->GetConfigItem());
                                       m_pAddressPage->GetWizard()->GetConfigItem());
        aDlg.run();
    }
};
diff --git a/sw/source/ui/dbui/addresslistdialog.hxx b/sw/source/ui/dbui/addresslistdialog.hxx
index 167cf6a..bf2d041 100644
--- a/sw/source/ui/dbui/addresslistdialog.hxx
+++ b/sw/source/ui/dbui/addresslistdialog.hxx
@@ -47,7 +47,7 @@ class SwAddressListDialog : public SfxDialogController

    bool            m_bInSelectHdl;

    VclPtr<SwMailMergeAddressBlockPage> m_xAddressPage;
    SwMailMergeAddressBlockPage* m_pAddressPage;

    css::uno::Reference< css::sdb::XDatabaseContext> m_xDBContext;

diff --git a/sw/source/ui/dbui/mailmergewizard.cxx b/sw/source/ui/dbui/mailmergewizard.cxx
index f7b6362..ceea20e 100644
--- a/sw/source/ui/dbui/mailmergewizard.cxx
+++ b/sw/source/ui/dbui/mailmergewizard.cxx
@@ -88,18 +88,18 @@ SwMailMergeWizard::~SwMailMergeWizard()
{
}

VclPtr<TabPage> SwMailMergeWizard::createPage(WizardState _nState)
std::unique_ptr<BuilderPage> SwMailMergeWizard::createPage(WizardState _nState)
{
    OString sIdent(OString::number(_nState));
    weld::Container* pPageContainer = m_xAssistant->append_page(sIdent);
    // TODO eventually pass DialogController as distinct argument instead of bundling into TabPageParent
    TabPageParent aParent(pPageContainer, this);

    VclPtr<vcl::OWizardPage> pRet;
    std::unique_ptr<vcl::OWizardPage> xRet;
    switch(_nState)
    {
        case MM_DOCUMENTSELECTPAGE :
            pRet = VclPtr<SwMailMergeDocSelectPage>::Create(this, aParent);
            xRet = std::make_unique<SwMailMergeDocSelectPage>(this, aParent);

            /* tdf#52986 Set help ID using SetRoadmapHelpId for all pages
            so that when by default the focus is on the left side pane of
@@ -108,28 +108,27 @@ VclPtr<TabPage> SwMailMergeWizard::createPage(WizardState _nState)
            SetRoadmapHelpId("modules/swriter/ui/mmselectpage/MMSelectPage");
        break;
        case MM_OUTPUTTYPETPAGE    :
            pRet = VclPtr<SwMailMergeOutputTypePage>::Create(this, aParent);
            xRet = std::make_unique<SwMailMergeOutputTypePage>(this, aParent);
            SetRoadmapHelpId("modules/swriter/ui/mmoutputtypepage/MMOutputTypePage");
        break;
        case MM_ADDRESSBLOCKPAGE   :
            pRet = VclPtr<SwMailMergeAddressBlockPage>::Create(this, aParent);
            xRet = std::make_unique<SwMailMergeAddressBlockPage>(this, aParent);
            SetRoadmapHelpId("modules/swriter/ui/mmaddressblockpage/MMAddressBlockPage");
        break;
        case MM_GREETINGSPAGE      :
            pRet = VclPtr<SwMailMergeGreetingsPage>::Create(this, aParent);
            xRet = std::make_unique<SwMailMergeGreetingsPage>(this, aParent);
            SetRoadmapHelpId("modules/swriter/ui/mmsalutationpage/MMSalutationPage");
        break;
        case MM_LAYOUTPAGE         :
            pRet = VclPtr<SwMailMergeLayoutPage>::Create(this, aParent);
            xRet = std::make_unique<SwMailMergeLayoutPage>(this, aParent);
            SetRoadmapHelpId("modules/swriter/ui/mmlayoutpage/MMLayoutPage");
        break;
    }

    m_xAssistant->set_page_title(sIdent, getStateDisplayName(_nState));


    OSL_ENSURE(pRet, "no page created in ::createPage");
    return pRet;
    OSL_ENSURE(xRet, "no page created in ::createPage");
    return xRet;
}

void SwMailMergeWizard::enterState( WizardState _nState )
@@ -199,7 +198,7 @@ void SwMailMergeWizard::UpdateRoadmap()

    // enableState( <page id>, false );
    const sal_uInt16 nCurPage = m_xAssistant->get_current_page();
    TabPage* pCurPage = GetPage( nCurPage );
    BuilderPage* pCurPage = GetPage( nCurPage );
    if(!pCurPage)
        return;
    bool bAddressFieldsConfigured = !m_xConfigItem->IsOutputToLetter() ||
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index ad9772a..da1fef3 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -109,17 +109,10 @@ SwMailMergeAddressBlockPage::SwMailMergeAddressBlockPage(SwMailMergeWizard* pWiz

SwMailMergeAddressBlockPage::~SwMailMergeAddressBlockPage()
{
    disposeOnce();
}

void SwMailMergeAddressBlockPage::dispose()
{
    m_xPreviewWIN.reset();
    m_xSettingsWIN.reset();
    m_xPreview.reset();
    m_xSettings.reset();

    vcl::OWizardPage::dispose();
}

bool SwMailMergeAddressBlockPage::canAdvance() const
@@ -127,7 +120,7 @@ bool SwMailMergeAddressBlockPage::canAdvance() const
    return m_pWizard->GetConfigItem().GetResultSet().is();
}

void SwMailMergeAddressBlockPage::ActivatePage()
void SwMailMergeAddressBlockPage::Activate()
{
    SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
    bool bIsLetter = rConfigItem.IsOutputToLetter();
diff --git a/sw/source/ui/dbui/mmaddressblockpage.hxx b/sw/source/ui/dbui/mmaddressblockpage.hxx
index 9b3111f..0e76558 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.hxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.hxx
@@ -77,14 +77,13 @@ class SwMailMergeAddressBlockPage : public vcl::OWizardPage

    void                EnableAddressBlock(bool bAll, bool bSelective);

    virtual void        ActivatePage() override;
    virtual void        Activate() override;
    virtual bool        commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) override;
    virtual bool        canAdvance() const override;

public:
    SwMailMergeAddressBlockPage(SwMailMergeWizard* pWizard, TabPageParent pParent);
    virtual ~SwMailMergeAddressBlockPage() override;
    virtual void dispose() override;
    SwMailMergeWizard* GetWizard() { return m_pWizard; }
};

diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx
index 0aa4470..83509f3 100644
--- a/sw/source/ui/dbui/mmgreetingspage.cxx
+++ b/sw/source/ui/dbui/mmgreetingspage.cxx
@@ -247,17 +247,11 @@ SwMailMergeGreetingsPage::SwMailMergeGreetingsPage(SwMailMergeWizard* pWizard, T

SwMailMergeGreetingsPage::~SwMailMergeGreetingsPage()
{
    disposeOnce();
}

void SwMailMergeGreetingsPage::dispose()
{
    m_xPreviewWIN.reset();
    m_xPreview.reset();
    vcl::OWizardPage::dispose();
}

void SwMailMergeGreetingsPage::ActivatePage()
void SwMailMergeGreetingsPage::Activate()
{
    //try to find the gender setting
    m_xFemaleColumnLB->clear();
diff --git a/sw/source/ui/dbui/mmgreetingspage.hxx b/sw/source/ui/dbui/mmgreetingspage.hxx
index a50d526..576fb98 100644
--- a/sw/source/ui/dbui/mmgreetingspage.hxx
+++ b/sw/source/ui/dbui/mmgreetingspage.hxx
@@ -103,12 +103,11 @@ class SwMailMergeGreetingsPage : public vcl::OWizardPage
    DECL_LINK(AssignHdl_Impl, weld::Button&, void);

    virtual void        UpdatePreview() override;
    virtual void        ActivatePage() override;
    virtual void        Activate() override;
    virtual bool        commitPage( ::vcl::WizardTypes::CommitPageReason _eReason ) override;
public:
    SwMailMergeGreetingsPage(SwMailMergeWizard* pWizard, TabPageParent pParent);
    virtual ~SwMailMergeGreetingsPage() override;
    virtual void dispose() override;
};

class SwMailBodyDialog : public SfxDialogController, public SwGreetingsHandler
diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx
index 2738f47..bcf40f8 100644
--- a/sw/source/ui/dbui/mmlayoutpage.cxx
+++ b/sw/source/ui/dbui/mmlayoutpage.cxx
@@ -153,16 +153,10 @@ SwMailMergeLayoutPage::SwMailMergeLayoutPage(SwMailMergeWizard* pWizard, TabPage

SwMailMergeLayoutPage::~SwMailMergeLayoutPage()
{
    disposeOnce();
}

void SwMailMergeLayoutPage::dispose()
{
    File::remove( m_sExampleURL );
    vcl::OWizardPage::dispose();
}

void SwMailMergeLayoutPage::ActivatePage()
void SwMailMergeLayoutPage::Activate()
{
    SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
    bool bGreetingLine = rConfigItem.IsGreetingLine(false) && !rConfigItem.IsGreetingInserted();
diff --git a/sw/source/ui/dbui/mmlayoutpage.hxx b/sw/source/ui/dbui/mmlayoutpage.hxx
index 6e63992..5ebff3e1 100644
--- a/sw/source/ui/dbui/mmlayoutpage.hxx
+++ b/sw/source/ui/dbui/mmlayoutpage.hxx
@@ -70,12 +70,11 @@ class SwMailMergeLayoutPage : public vcl::OWizardPage
                            bool bExample);
    static void             InsertGreeting(SwWrtShell& rShell, SwMailMergeConfigItem const & rConfigItem, bool bExample);

    virtual void        ActivatePage() override;
    virtual void        Activate() override;
    virtual bool        commitPage(::vcl::WizardTypes::CommitPageReason _eReason) override;
public:
    SwMailMergeLayoutPage(SwMailMergeWizard* pWizard, TabPageParent pParent);
    virtual ~SwMailMergeLayoutPage() override;
    virtual void            dispose() override;

    static SwFrameFormat*        InsertAddressAndGreeting(SwView const * pView,
                                            SwMailMergeConfigItem& rConfigItem,
diff --git a/sw/source/ui/dialog/docstdlg.cxx b/sw/source/ui/dialog/docstdlg.cxx
index 8208b87..5aab6a7 100644
--- a/sw/source/ui/dialog/docstdlg.cxx
+++ b/sw/source/ui/dialog/docstdlg.cxx
@@ -33,10 +33,11 @@

#include <unotools/localedatawrapper.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>

VclPtr<SfxTabPage> SwDocStatPage::Create(TabPageParent pParent, const SfxItemSet *rSet)
std::unique_ptr<SfxTabPage> SwDocStatPage::Create(TabPageParent pParent, const SfxItemSet *rSet)
{
    return VclPtr<SwDocStatPage>::Create(pParent, *rSet);
    return std::make_unique<SwDocStatPage>(pParent, *rSet);
}

SwDocStatPage::SwDocStatPage(TabPageParent pParent, const SfxItemSet &rSet)
@@ -83,7 +84,7 @@ void  SwDocStatPage::Reset(const SfxItemSet *)
// Description: update / set data
void SwDocStatPage::SetData(const SwDocStat &rStat)
{
    const LocaleDataWrapper& rLocaleData = GetSettings().GetUILocaleDataWrapper();
    const LocaleDataWrapper& rLocaleData = Application::GetSettings().GetUILocaleDataWrapper();
    m_xTableNo->set_label(rLocaleData.getNum(rStat.nTable, 0));
    m_xGrfNo->set_label(rLocaleData.getNum(rStat.nGrf, 0));
    m_xOLENo->set_label(rLocaleData.getNum(rStat.nOLE, 0));
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index edcb298..1099f63 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -1513,7 +1513,6 @@ SwInsertSectionTabPage::SwInsertSectionTabPage(TabPageParent pParent, const SfxI

SwInsertSectionTabPage::~SwInsertSectionTabPage()
{
    disposeOnce();
}

void    SwInsertSectionTabPage::SetWrtShell(SwWrtShell& rSh)
@@ -1616,10 +1615,10 @@ void SwInsertSectionTabPage::Reset( const SfxItemSet* )
{
}

VclPtr<SfxTabPage> SwInsertSectionTabPage::Create(TabPageParent pParent,
std::unique_ptr<SfxTabPage> SwInsertSectionTabPage::Create(TabPageParent pParent,
                                                  const SfxItemSet* rAttrSet)
{
    return VclPtr<SwInsertSectionTabPage>::Create(pParent, *rAttrSet);
    return std::make_unique<SwInsertSectionTabPage>(pParent, *rAttrSet);
}

IMPL_LINK(SwInsertSectionTabPage, ChangeHideHdl, weld::ToggleButton&, rBox, void)
@@ -1954,10 +1953,10 @@ void SwSectionFootnoteEndTabPage::Reset( const SfxItemSet* rSet )
    ResetState( false, rSet->Get( RES_END_AT_TXTEND, false ));
}

VclPtr<SfxTabPage> SwSectionFootnoteEndTabPage::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> SwSectionFootnoteEndTabPage::Create( TabPageParent pParent,
                                                   const SfxItemSet* rAttrSet)
{
    return VclPtr<SwSectionFootnoteEndTabPage>::Create(pParent, *rAttrSet);
    return std::make_unique<SwSectionFootnoteEndTabPage>(pParent, *rAttrSet);
}

IMPL_LINK( SwSectionFootnoteEndTabPage, FootEndHdl, weld::ToggleButton&, rBox, void )
@@ -2112,9 +2111,9 @@ void SwSectionIndentTabPage::Reset( const SfxItemSet* rSet)
    IndentModifyHdl(*m_xBeforeMF);
}

VclPtr<SfxTabPage> SwSectionIndentTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
std::unique_ptr<SfxTabPage> SwSectionIndentTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
{
    return VclPtr<SwSectionIndentTabPage>::Create(pParent, *rAttrSet);
    return std::make_unique<SwSectionIndentTabPage>(pParent, *rAttrSet);
}

void SwSectionIndentTabPage::SetWrtShell(SwWrtShell const & rSh)
diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx
index 528d202..12a3cd8 100644
--- a/sw/source/ui/envelp/envfmt.cxx
+++ b/sw/source/ui/envelp/envfmt.cxx
@@ -187,7 +187,6 @@ void SwEnvFormatPage::Init(SwEnvDlg* pDialog)

SwEnvFormatPage::~SwEnvFormatPage()
{
    disposeOnce();
}

IMPL_LINK( SwEnvFormatPage, ModifyHdl, weld::MetricSpinButton&, rEdit, void )
@@ -413,9 +412,9 @@ void SwEnvFormatPage::SetMinMax()
                               100 * (getfieldval(*m_xAddrTopField ) - 2 * 566), FieldUnit::TWIP);
}

VclPtr<SfxTabPage> SwEnvFormatPage::Create(TabPageParent pParent, const SfxItemSet* rSet)
std::unique_ptr<SfxTabPage> SwEnvFormatPage::Create(TabPageParent pParent, const SfxItemSet* rSet)
{
    return VclPtr<SwEnvFormatPage>::Create(pParent, *rSet);
    return std::make_unique<SwEnvFormatPage>(pParent, *rSet);
}

void SwEnvFormatPage::ActivatePage(const SfxItemSet& rSet)
diff --git a/sw/source/ui/envelp/envfmt.hxx b/sw/source/ui/envelp/envfmt.hxx
index 20f2bd3..531e340 100644
--- a/sw/source/ui/envelp/envfmt.hxx
+++ b/sw/source/ui/envelp/envfmt.hxx
@@ -54,15 +54,12 @@ class SwEnvFormatPage : public SfxTabPage

    SwEnvDlg    *GetParentSwEnvDlg() { return m_pDialog; }

    using TabPage::ActivatePage;
    using TabPage::DeactivatePage;

public:
    SwEnvFormatPage(TabPageParent pParent, const SfxItemSet& rSet);
    void Init(SwEnvDlg* pDialog);
    virtual ~SwEnvFormatPage() override;

    static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet);

    virtual void ActivatePage(const SfxItemSet& rSet) override;
    virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override;
diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx
index f890236..bf18718 100644
--- a/sw/source/ui/envelp/envlop1.cxx
+++ b/sw/source/ui/envelp/envlop1.cxx
@@ -226,7 +226,6 @@ void SwEnvPage::Init(SwEnvDlg* pDialog)

SwEnvPage::~SwEnvPage()
{
    disposeOnce();
}

IMPL_LINK( SwEnvPage, DatabaseHdl, weld::ComboBox&, rListBox, void )
@@ -298,9 +297,9 @@ void SwEnvPage::InitDatabaseBox()
    }
}

VclPtr<SfxTabPage> SwEnvPage::Create(TabPageParent pParent, const SfxItemSet* rSet)
std::unique_ptr<SfxTabPage> SwEnvPage::Create(TabPageParent pParent, const SfxItemSet* rSet)
{
    return VclPtr<SwEnvPage>::Create(pParent, *rSet);
    return std::make_unique<SwEnvPage>(pParent, *rSet);
}

void SwEnvPage::ActivatePage(const SfxItemSet& rSet)
diff --git a/sw/source/ui/envelp/envprt.cxx b/sw/source/ui/envelp/envprt.cxx
index cc62d67..fdfca43 100644
--- a/sw/source/ui/envelp/envprt.cxx
+++ b/sw/source/ui/envelp/envprt.cxx
@@ -76,7 +76,7 @@ SwEnvPrtPage::SwEnvPrtPage(TabPageParent pParent, const SfxItemSet& rSet)

SwEnvPrtPage::~SwEnvPrtPage()
{
    disposeOnce();
    m_xPrt.clear();
}

IMPL_LINK_NOARG(SwEnvPrtPage, ClickHdl, weld::ToggleButton&, void)
@@ -127,9 +127,9 @@ IMPL_LINK(SwEnvPrtPage, ButtonHdl, weld::Button&, rBtn, void)
    }
}

VclPtr<SfxTabPage> SwEnvPrtPage::Create(TabPageParent pParent, const SfxItemSet* rSet)
std::unique_ptr<SfxTabPage> SwEnvPrtPage::Create(TabPageParent pParent, const SfxItemSet* rSet)
{
    return VclPtr<SwEnvPrtPage>::Create(pParent, *rSet);
    return std::make_unique<SwEnvPrtPage>(pParent, *rSet);
}

void SwEnvPrtPage::ActivatePage(const SfxItemSet&)
diff --git a/sw/source/ui/envelp/envprt.hxx b/sw/source/ui/envelp/envprt.hxx
index 6e5e7d9..e86c0df 100644
--- a/sw/source/ui/envelp/envprt.hxx
+++ b/sw/source/ui/envelp/envprt.hxx
@@ -53,19 +53,11 @@ class SwEnvPrtPage : public SfxTabPage

    SwEnvDlg* GetParentSwEnvDlg() {return static_cast<SwEnvDlg*>(GetDialogController()); }

    using TabPage::ActivatePage;
    using TabPage::DeactivatePage;

public:
    SwEnvPrtPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual void dispose() override
    {
        m_xPrt.clear();
        SfxTabPage::dispose();
    }
    virtual ~SwEnvPrtPage() override;

    static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet);

    virtual void ActivatePage(const SfxItemSet& rSet) override;
    virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override;
diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx
index e1e42ba..1a64abb 100644
--- a/sw/source/ui/envelp/label1.cxx
+++ b/sw/source/ui/envelp/label1.cxx
@@ -90,14 +90,14 @@ void SwLabDlg::PageCreated(const OString &rId, SfxTabPage &rPage)
            static_cast<SwLabPage*>(&rPage)->SetToBusinessCard();
    }
    else if (rId == "options")
        pPrtPage = static_cast<SwLabPrtPage*>(&rPage);
        m_pPrtPage = static_cast<SwLabPrtPage*>(&rPage);
}

SwLabDlg::SwLabDlg(weld::Window* pParent, const SfxItemSet& rSet,
                                SwDBManager* pDBManager_, bool bLabel)
    : SfxTabDialogController(pParent, "modules/swriter/ui/labeldialog.ui", "LabelDialog", &rSet)
    , pDBManager(pDBManager_)
    , pPrtPage(nullptr)
    , m_pPrtPage(nullptr)
    , aTypeIds(50, 10)
    , m_pRecs(new SwLabRecs)
    , m_bLabel(bLabel)
@@ -214,8 +214,8 @@ SwLabRec* SwLabDlg::GetRecord(const OUString &rRecName, bool bCont)

Printer *SwLabDlg::GetPrt()
{
    if (pPrtPage)
        return pPrtPage->GetPrt();
    if (m_pPrtPage)
        return m_pPrtPage->GetPrt();
    else
        return nullptr;
}
@@ -446,9 +446,9 @@ void SwLabPage::InitDatabaseBox()
    }
}

VclPtr<SfxTabPage> SwLabPage::Create(TabPageParent pParent, const SfxItemSet* rSet)
std::unique_ptr<SfxTabPage> SwLabPage::Create(TabPageParent pParent, const SfxItemSet* rSet)
{
    return VclPtr<SwLabPage>::Create(pParent, *rSet);
    return std::make_unique<SwLabPage>(pParent, *rSet);
}

void SwLabPage::ActivatePage(const SfxItemSet& rSet)
@@ -574,9 +574,9 @@ SwPrivateDataPage::~SwPrivateDataPage()
{
}

VclPtr<SfxTabPage> SwPrivateDataPage::Create(TabPageParent pParent, const SfxItemSet* rSet)
std::unique_ptr<SfxTabPage> SwPrivateDataPage::Create(TabPageParent pParent, const SfxItemSet* rSet)
{
    return VclPtr<SwPrivateDataPage>::Create(pParent, *rSet);
    return std::make_unique<SwPrivateDataPage>(pParent, *rSet);
}

void SwPrivateDataPage::ActivatePage(const SfxItemSet& rSet)
@@ -667,9 +667,9 @@ SwBusinessDataPage::~SwBusinessDataPage()
{
}

VclPtr<SfxTabPage> SwBusinessDataPage::Create(TabPageParent pParent, const SfxItemSet* rSet)
std::unique_ptr<SfxTabPage> SwBusinessDataPage::Create(TabPageParent pParent, const SfxItemSet* rSet)
{
    return VclPtr<SwBusinessDataPage>::Create(pParent, *rSet);
    return std::make_unique<SwBusinessDataPage>(pParent, *rSet);
}

void SwBusinessDataPage::ActivatePage(const SfxItemSet& rSet)
diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx
index 7f2d9ec..9144214 100644
--- a/sw/source/ui/envelp/labfmt.cxx
+++ b/sw/source/ui/envelp/labfmt.cxx
@@ -403,9 +403,9 @@ void SwLabFormatPage::ChangeMinMax()
    m_xPHeightField->set_range(long(100) * lMinPHeight, long(100) * lMax, FieldUnit::TWIP);
}

VclPtr<SfxTabPage> SwLabFormatPage::Create(TabPageParent pParent, const SfxItemSet* rSet)
std::unique_ptr<SfxTabPage> SwLabFormatPage::Create(TabPageParent pParent, const SfxItemSet* rSet)
{
    return VclPtr<SwLabFormatPage>::Create(pParent, *rSet);
    return std::make_unique<SwLabFormatPage>(pParent, *rSet);
}

void SwLabFormatPage::ActivatePage(const SfxItemSet& rSet)
diff --git a/sw/source/ui/envelp/labfmt.hxx b/sw/source/ui/envelp/labfmt.hxx
index 208b1bc..f4d5596 100644
--- a/sw/source/ui/envelp/labfmt.hxx
+++ b/sw/source/ui/envelp/labfmt.hxx
@@ -95,14 +95,11 @@ class SwLabFormatPage : public SfxTabPage

    void ChangeMinMax();

    using TabPage::ActivatePage;
    using TabPage::DeactivatePage;

public:
    SwLabFormatPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual ~SwLabFormatPage() override;

    static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet);

    virtual void ActivatePage(const SfxItemSet& rSet) override;
    virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override;
diff --git a/sw/source/ui/envelp/labprt.cxx b/sw/source/ui/envelp/labprt.cxx
index 337ae96..cefe413 100644
--- a/sw/source/ui/envelp/labprt.cxx
+++ b/sw/source/ui/envelp/labprt.cxx
@@ -57,13 +57,7 @@ SwLabPrtPage::SwLabPrtPage(TabPageParent pParent, const SfxItemSet& rSet)

SwLabPrtPage::~SwLabPrtPage()
{
    disposeOnce();
}

void SwLabPrtPage::dispose()
{
    pPrinter.disposeAndClear();
    SfxTabPage::dispose();
}

IMPL_LINK( SwLabPrtPage, CountHdl, weld::Button&, rButton, void )
@@ -74,7 +68,7 @@ IMPL_LINK( SwLabPrtPage, CountHdl, weld::Button&, rButton, void )
        if (!pPrinter)
            pPrinter = VclPtr<Printer>::Create();

        PrinterSetupDialog aDlg(GetFrameWeld());
        PrinterSetupDialog aDlg(GetDialogFrameWeld());
        aDlg.SetPrinter(pPrinter);
        aDlg.run();
        rButton.grab_focus();
@@ -92,9 +86,9 @@ IMPL_LINK( SwLabPrtPage, CountHdl, weld::Button&, rButton, void )
    }
}

VclPtr<SfxTabPage> SwLabPrtPage::Create(TabPageParent pParent, const SfxItemSet* rSet)
std::unique_ptr<SfxTabPage> SwLabPrtPage::Create(TabPageParent pParent, const SfxItemSet* rSet)
{
    return VclPtr<SwLabPrtPage>::Create(pParent, *rSet );
    return std::make_unique<SwLabPrtPage>(pParent, *rSet );
}

void SwLabPrtPage::ActivatePage( const SfxItemSet& rSet )
diff --git a/sw/source/ui/envelp/labprt.hxx b/sw/source/ui/envelp/labprt.hxx
index f253653..8c35033 100644
--- a/sw/source/ui/envelp/labprt.hxx
+++ b/sw/source/ui/envelp/labprt.hxx
@@ -44,15 +44,11 @@ class SwLabPrtPage : public SfxTabPage

    SwLabDlg* GetParentSwLabDlg() {return static_cast<SwLabDlg*>(GetDialogController());}

    using TabPage::ActivatePage;
    using TabPage::DeactivatePage;

public:
    SwLabPrtPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual ~SwLabPrtPage() override;
    virtual void dispose() override;

    static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet);

    virtual void ActivatePage(const SfxItemSet& rSet) override;
    virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override;
diff --git a/sw/source/ui/envelp/swuilabimp.hxx b/sw/source/ui/envelp/swuilabimp.hxx
index f426694..ff81d3b 100644
--- a/sw/source/ui/envelp/swuilabimp.hxx
+++ b/sw/source/ui/envelp/swuilabimp.hxx
@@ -54,15 +54,12 @@ class SwLabPage : public SfxTabPage
    void DisplayFormat  ();
    SwLabRec* GetSelectedEntryPos();

    using TabPage::ActivatePage;
    using TabPage::DeactivatePage;

public:
    SwLabPage(TabPageParent pParent, const SfxItemSet& rSet);

    virtual ~SwLabPage() override;

    static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet);

    virtual void ActivatePage(const SfxItemSet& rSet) override;
    virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override;
@@ -100,14 +97,11 @@ class SwPrivateDataPage : public SfxTabPage
    std::unique_ptr<weld::Entry> m_xHomePageED;
    std::unique_ptr<weld::Entry> m_xMailED;

    using TabPage::ActivatePage;
    using TabPage::DeactivatePage;

public:
    SwPrivateDataPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual ~SwPrivateDataPage() override;

    static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet);

    virtual void ActivatePage(const SfxItemSet& rSet) override;
    virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override;
@@ -132,14 +126,11 @@ class SwBusinessDataPage : public SfxTabPage
    std::unique_ptr<weld::Entry> m_xHomePageED;
    std::unique_ptr<weld::Entry> m_xMailED;

    using TabPage::ActivatePage;
    using TabPage::DeactivatePage;

public:
    SwBusinessDataPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual ~SwBusinessDataPage() override;

    static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet);

    virtual void ActivatePage(const SfxItemSet& rSet) override;
    virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override;
diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx
index 37fc878..e8b959e 100644
--- a/sw/source/ui/fldui/flddb.cxx
+++ b/sw/source/ui/fldui/flddb.cxx
@@ -70,11 +70,6 @@ SwFieldDBPage::SwFieldDBPage(TabPageParent pParent, const SfxItemSet *const pCor

SwFieldDBPage::~SwFieldDBPage()
{
    disposeOnce();
}

void SwFieldDBPage::dispose()
{
    SwWrtShell* pSh = GetWrtShell();
    if (!pSh)
        pSh = ::GetActiveWrtShell();
@@ -82,8 +77,6 @@ void SwFieldDBPage::dispose()
    SwDBManager* pDbManager = pSh->GetDoc()->GetDBManager();
    if (pDbManager)
        pDbManager->RevokeLastRegistrations();

    SwFieldPage::dispose();
}

// initialise TabPage
@@ -262,10 +255,10 @@ bool SwFieldDBPage::FillItemSet(SfxItemSet* )
    return false;
}

VclPtr<SfxTabPage> SwFieldDBPage::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> SwFieldDBPage::Create( TabPageParent pParent,
                                        const SfxItemSet *const pAttrSet )
{
    return VclPtr<SwFieldDBPage>::Create( pParent, pAttrSet );
    return std::make_unique<SwFieldDBPage>( pParent, pAttrSet );
}

sal_uInt16 SwFieldDBPage::GetGroup()
diff --git a/sw/source/ui/fldui/flddb.hxx b/sw/source/ui/fldui/flddb.hxx
index e1a8207..aac2b5f 100644
--- a/sw/source/ui/fldui/flddb.hxx
+++ b/sw/source/ui/fldui/flddb.hxx
@@ -64,9 +64,8 @@ public:
    SwFieldDBPage(TabPageParent pParent, const SfxItemSet* rSet);

    virtual ~SwFieldDBPage() override;
    virtual void        dispose() override;

    static VclPtr<SfxTabPage>  Create(TabPageParent pParent, const SfxItemSet* rAttrSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet);

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx
index bcdbbbf..e077868 100644
--- a/sw/source/ui/fldui/flddinf.cxx
+++ b/sw/source/ui/fldui/flddinf.cxx
@@ -83,7 +83,6 @@ SwFieldDokInfPage::SwFieldDokInfPage(TabPageParent pParent, const SfxItemSet *co

SwFieldDokInfPage::~SwFieldDokInfPage()
{
    disposeOnce();
}

void SwFieldDokInfPage::Reset(const SfxItemSet* )
@@ -444,10 +443,10 @@ bool SwFieldDokInfPage::FillItemSet(SfxItemSet* )
    return false;
}

VclPtr<SfxTabPage> SwFieldDokInfPage::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> SwFieldDokInfPage::Create( TabPageParent pParent,
                                            const SfxItemSet *const pAttrSet)
{
    return VclPtr<SwFieldDokInfPage>::Create(pParent, pAttrSet);
    return std::make_unique<SwFieldDokInfPage>(pParent, pAttrSet);
}

sal_uInt16 SwFieldDokInfPage::GetGroup()
diff --git a/sw/source/ui/fldui/flddinf.hxx b/sw/source/ui/fldui/flddinf.hxx
index ed36cf5..15c09d9 100644
--- a/sw/source/ui/fldui/flddinf.hxx
+++ b/sw/source/ui/fldui/flddinf.hxx
@@ -55,7 +55,7 @@ public:
    SwFieldDokInfPage(TabPageParent pWindow, const SfxItemSet* pSet);
    virtual ~SwFieldDokInfPage() override;

    static VclPtr<SfxTabPage>  Create(TabPageParent pParent, const SfxItemSet* rAttrSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet);

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx
index 6d6b9ff..d1d04e9 100644
--- a/sw/source/ui/fldui/flddok.cxx
+++ b/sw/source/ui/fldui/flddok.cxx
@@ -74,7 +74,6 @@ SwFieldDokPage::SwFieldDokPage(TabPageParent pParent, const SfxItemSet *const pC

SwFieldDokPage::~SwFieldDokPage()
{
    disposeOnce();
}

void SwFieldDokPage::Reset(const SfxItemSet* )
@@ -609,10 +608,10 @@ bool SwFieldDokPage::FillItemSet(SfxItemSet* )
    return false;
}

VclPtr<SfxTabPage> SwFieldDokPage::Create(TabPageParent pParent,
std::unique_ptr<SfxTabPage> SwFieldDokPage::Create(TabPageParent pParent,
                                          const SfxItemSet *const pAttrSet)
{
    return VclPtr<SwFieldDokPage>::Create(pParent, pAttrSet);
    return std::make_unique<SwFieldDokPage>(pParent, pAttrSet);
}

sal_uInt16 SwFieldDokPage::GetGroup()
diff --git a/sw/source/ui/fldui/flddok.hxx b/sw/source/ui/fldui/flddok.hxx
index 4ed50de..2fd437d7 100644
--- a/sw/source/ui/fldui/flddok.hxx
+++ b/sw/source/ui/fldui/flddok.hxx
@@ -59,7 +59,7 @@ public:

    virtual ~SwFieldDokPage() override;

    static VclPtr<SfxTabPage>  Create(TabPageParent pParent, const SfxItemSet* rAttrSet);
    static std::unique_ptr<SfxTabPage>  Create(TabPageParent pParent, const SfxItemSet* rAttrSet);

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx
index 84074dd..8cd8577 100644
--- a/sw/source/ui/fldui/fldedt.cxx
+++ b/sw/source/ui/fldui/fldedt.cxx
@@ -135,9 +135,8 @@ SwFieldEditDlg::SwFieldEditDlg(SwView const & rVw)
// initialise controls
void SwFieldEditDlg::Init()
{
    VclPtr<SwFieldPage> pTabPage = static_cast<SwFieldPage*>(GetTabPage());

    if( pTabPage )
    SwFieldPage* pTabPage = static_cast<SwFieldPage*>(GetTabPage());
    if (pTabPage)
    {
        SwFieldMgr& rMgr = pTabPage->GetFieldMgr();

@@ -174,23 +173,23 @@ void SwFieldEditDlg::Init()
                                !pSh->HasReadonlySel());
}

VclPtr<SfxTabPage> SwFieldEditDlg::CreatePage(sal_uInt16 nGroup)
SfxTabPage* SwFieldEditDlg::CreatePage(sal_uInt16 nGroup)
{
    TabPageParent pPageParent(get_content_area(), this);

    // create TabPage
    VclPtr<SfxTabPage> pTabPage;
    std::unique_ptr<SfxTabPage> xTabPage;

    switch (nGroup)
    {
        case GRP_DOC:
            pTabPage = SwFieldDokPage::Create(pPageParent, nullptr);
            xTabPage = SwFieldDokPage::Create(pPageParent, nullptr);
            break;
        case GRP_FKT:
            pTabPage = SwFieldFuncPage::Create(pPageParent, nullptr);
            xTabPage = SwFieldFuncPage::Create(pPageParent, nullptr);
            break;
        case GRP_REF:
            pTabPage = SwFieldRefPage::Create(pPageParent, nullptr);
            xTabPage = SwFieldRefPage::Create(pPageParent, nullptr);
            break;
        case GRP_REG:
            {
@@ -205,30 +204,27 @@ VclPtr<SfxTabPage> SwFieldEditDlg::CreatePage(sal_uInt16 nGroup)
                    xDocProps->getUserDefinedProperties(),
                    uno::UNO_QUERY_THROW);
                pSet->Put( SfxUnoAnyItem( SID_DOCINFO, uno::makeAny(xUDProps) ) );
                pTabPage = SwFieldDokInfPage::Create(pPageParent, pSet);
                xTabPage = SwFieldDokInfPage::Create(pPageParent, pSet);
                break;
            }
#if HAVE_FEATURE_DBCONNECTIVITY
        case GRP_DB:
            pTabPage = SwFieldDBPage::Create(pPageParent, nullptr);
            static_cast<SwFieldDBPage*>(pTabPage.get())->SetWrtShell(*pSh);
            xTabPage = SwFieldDBPage::Create(pPageParent, nullptr);
            static_cast<SwFieldDBPage*>(xTabPage.get())->SetWrtShell(*pSh);
            break;
#endif
        case GRP_VAR:
            pTabPage = SwFieldVarPage::Create(pPageParent, nullptr);
            xTabPage = SwFieldVarPage::Create(pPageParent, nullptr);
            break;

    }

    assert(pTabPage);
    assert(xTabPage);

    if (pTabPage)
    {
        static_cast<SwFieldPage*>(pTabPage.get())->SetWrtShell(pSh);
        SetTabPage(pTabPage);
    }
    static_cast<SwFieldPage*>(xTabPage.get())->SetWrtShell(pSh);
    SetTabPage(std::move(xTabPage));

    return pTabPage;
    return GetTabPage();
}

SwFieldEditDlg::~SwFieldEditDlg()
@@ -254,7 +250,7 @@ IMPL_LINK_NOARG(SwFieldEditDlg, OKHdl, weld::Button&, void)
{
    if (GetOKButton().get_sensitive())
    {
        VclPtr<SfxTabPage> pTabPage = GetTabPage();
        SfxTabPage* pTabPage = GetTabPage();
        if (pTabPage)
            pTabPage->FillItemSet(nullptr);
        m_xDialog->response(RET_OK);
@@ -275,7 +271,7 @@ IMPL_LINK(SwFieldEditDlg, NextPrevHdl, weld::Button&, rButton, void)
    pSh->EnterStdMode();

    SwFieldType *pOldTyp = nullptr;
    VclPtr<SwFieldPage> pTabPage = static_cast<SwFieldPage*>(GetTabPage());
    SwFieldPage* pTabPage = static_cast<SwFieldPage*>(GetTabPage());

    //#112462# FillItemSet may delete the current field
    //that's why it has to be called before accessing the current field
@@ -295,7 +291,7 @@ IMPL_LINK(SwFieldEditDlg, NextPrevHdl, weld::Button&, rButton, void)
    sal_uInt16 nGroup = SwFieldMgr::GetGroup(pCurField->GetTypeId(), pCurField->GetSubType());

    if (nGroup != pTabPage->GetGroup())
        pTabPage = static_cast<SwFieldPage*>(CreatePage(nGroup).get());
        pTabPage = static_cast<SwFieldPage*>(CreatePage(nGroup));

    pTabPage->EditNewField();

diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx
index 0161212..f140b30 100644
--- a/sw/source/ui/fldui/fldfunc.cxx
+++ b/sw/source/ui/fldui/fldfunc.cxx
@@ -89,7 +89,6 @@ SwFieldFuncPage::SwFieldFuncPage(TabPageParent pParent, const SfxItemSet *const 

SwFieldFuncPage::~SwFieldFuncPage()
{
    disposeOnce();
}

void SwFieldFuncPage::Reset(const SfxItemSet* )
@@ -576,10 +575,10 @@ bool SwFieldFuncPage::FillItemSet(SfxItemSet* )
    return false;
}

VclPtr<SfxTabPage> SwFieldFuncPage::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> SwFieldFuncPage::Create( TabPageParent pParent,
                                          const SfxItemSet *const pAttrSet)
{
    return VclPtr<SwFieldFuncPage>::Create( pParent, pAttrSet );
    return std::make_unique<SwFieldFuncPage>(pParent, pAttrSet);
}

sal_uInt16 SwFieldFuncPage::GetGroup()
diff --git a/sw/source/ui/fldui/fldfunc.hxx b/sw/source/ui/fldui/fldfunc.hxx
index 24a1264..78588ad 100644
--- a/sw/source/ui/fldui/fldfunc.hxx
+++ b/sw/source/ui/fldui/fldfunc.hxx
@@ -82,7 +82,7 @@ public:
    SwFieldFuncPage(TabPageParent pParent, const SfxItemSet* pSet);
    virtual ~SwFieldFuncPage() override;

    static VclPtr<SfxTabPage>  Create(TabPageParent pParent, const SfxItemSet* rAttrSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet);

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx
index b200528..ba7673c 100644
--- a/sw/source/ui/fldui/fldpage.cxx
+++ b/sw/source/ui/fldui/fldpage.cxx
@@ -97,7 +97,7 @@ void SwFieldPage::Init()
}

// newly initialise page
void SwFieldPage::ActivatePage()
void SwFieldPage::Activate()
{
    EnableInsert(m_bInsert);
}
diff --git a/sw/source/ui/fldui/fldpage.hxx b/sw/source/ui/fldui/fldpage.hxx
index 5fd9429..98cfd67 100644
--- a/sw/source/ui/fldui/fldpage.hxx
+++ b/sw/source/ui/fldui/fldpage.hxx
@@ -70,15 +70,13 @@ protected:
                                    sal_Unicode cDelim = ' ',
                                    bool bIsAutomaticLanguage = true);

    using SfxTabPage::ActivatePage;

public:
    SwFieldPage(TabPageParent pParent, const OUString& rUIXMLDescription,
        const OString& rID, const SfxItemSet *pAttrSet);

    virtual ~SwFieldPage() override;

    virtual void        ActivatePage() override;
    virtual void        Activate() override;

    SwFieldMgr&    GetFieldMgr()         { return m_aMgr; }
    void                SetWrtShell( SwWrtShell* m_pWrtShell );
diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx
index dc5d369..e41c9d7 100644
--- a/sw/source/ui/fldui/fldref.cxx
+++ b/sw/source/ui/fldui/fldref.cxx
@@ -110,7 +110,6 @@ SwFieldRefPage::SwFieldRefPage(TabPageParent pParent, const SfxItemSet *const pC

SwFieldRefPage::~SwFieldRefPage()
{
    disposeOnce();
}

IMPL_LINK_NOARG(SwFieldRefPage, ModifyHdl_Impl, weld::Entry&, void)
@@ -1085,10 +1084,10 @@ bool SwFieldRefPage::FillItemSet(SfxItemSet* )
    return false;
}

VclPtr<SfxTabPage> SwFieldRefPage::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> SwFieldRefPage::Create( TabPageParent pParent,
                                         const SfxItemSet *const pAttrSet)
{
    return VclPtr<SwFieldRefPage>::Create( pParent, pAttrSet );
    return std::make_unique<SwFieldRefPage>(pParent, pAttrSet);
}

sal_uInt16 SwFieldRefPage::GetGroup()
diff --git a/sw/source/ui/fldui/fldref.hxx b/sw/source/ui/fldui/fldref.hxx
index 9add08a..d578e10 100644
--- a/sw/source/ui/fldui/fldref.hxx
+++ b/sw/source/ui/fldui/fldref.hxx
@@ -80,7 +80,7 @@ public:
    SwFieldRefPage(TabPageParent pParent, const SfxItemSet* pSet);
    virtual ~SwFieldRefPage() override;

    static VclPtr<SfxTabPage>  Create(TabPageParent pParent, const SfxItemSet* rAttrSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet);

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx
index e2431cf..b5aa075 100644
--- a/sw/source/ui/fldui/fldvar.cxx
+++ b/sw/source/ui/fldui/fldvar.cxx
@@ -84,7 +84,6 @@ SwFieldVarPage::SwFieldVarPage(TabPageParent pParent, const SfxItemSet *const pC

SwFieldVarPage::~SwFieldVarPage()
{
    disposeOnce();
}

void SwFieldVarPage::Reset(const SfxItemSet* )
@@ -1204,10 +1203,10 @@ bool SwFieldVarPage::FillItemSet(SfxItemSet* )
    return false;
}

VclPtr<SfxTabPage> SwFieldVarPage::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> SwFieldVarPage::Create( TabPageParent pParent,
                                         const SfxItemSet *const pAttrSet)
{
    return VclPtr<SwFieldVarPage>::Create( pParent, pAttrSet );
    return std::make_unique<SwFieldVarPage>( pParent, pAttrSet );
}

sal_uInt16 SwFieldVarPage::GetGroup()
diff --git a/sw/source/ui/fldui/fldvar.hxx b/sw/source/ui/fldui/fldvar.hxx
index 245f575..d47d3f8 100644
--- a/sw/source/ui/fldui/fldvar.hxx
+++ b/sw/source/ui/fldui/fldvar.hxx
@@ -70,11 +70,9 @@ protected:

public:
    SwFieldVarPage(TabPageParent pParent, const SfxItemSet* pSet);

    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet);
    virtual ~SwFieldVarPage() override;

    static VclPtr<SfxTabPage>  Create(TabPageParent pParent, const SfxItemSet* rAttrSet);

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;

diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index 769bf2d..6e27d1d 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -167,9 +167,9 @@ SwColumnDlg::SwColumnDlg(weld::Window* pParent, SwWrtShell& rSh)
    assert(pColPgSet);

    // create TabPage
    m_pTabPage = static_cast<SwColumnPage*>(SwColumnPage::Create(TabPageParent(m_xContentArea.get(), this), pColPgSet).get());
    m_pTabPage->GetApplyLabel()->show();
    weld::ComboBox* pApplyToLB = m_pTabPage->GetApplyComboBox();
    m_xTabPage = std::make_unique<SwColumnPage>(TabPageParent(m_xContentArea.get(), this), *pColPgSet);
    m_xTabPage->GetApplyLabel()->show();
    weld::ComboBox* pApplyToLB = m_xTabPage->GetApplyComboBox();
    pApplyToLB->show();

    if (pCurrSection && (!m_rWrtShell.HasSelection() || 0 != nFullSectCnt))
@@ -210,13 +210,12 @@ SwColumnDlg::SwColumnDlg(weld::Window* pParent, SwWrtShell& rSh)
    if (!pApplyToLB->get_count())
        m_xOkButton->set_sensitive(false);
    //#i97810# set focus to the TabPage
    m_pTabPage->ActivateColumnControl();
    m_pTabPage->Show();
    m_xTabPage->ActivateColumnControl();
}

SwColumnDlg::~SwColumnDlg()
{
    m_pTabPage.disposeAndClear();
    m_xTabPage.reset();
}

IMPL_LINK(SwColumnDlg, ObjectListBoxHdl, weld::ComboBox&, rBox, void)
@@ -230,9 +229,9 @@ void SwColumnDlg::ObjectHdl(const weld::ComboBox* pBox)

    if (pBox)
    {
        m_pTabPage->FillItemSet(pSet);
        m_xTabPage->FillItemSet(pSet);
    }
    weld::ComboBox* pApplyToLB = m_pTabPage->GetApplyComboBox();
    weld::ComboBox* pApplyToLB = m_xTabPage->GetApplyComboBox();
    m_nOldSelection = pApplyToLB->get_active_id().toInt32();
    long nWidth = m_nSelectionWidth;
    switch(m_nOldSelection)
@@ -258,19 +257,19 @@ void SwColumnDlg::ObjectHdl(const weld::ComboBox* pBox)
    }

    bool bIsSection = pSet == m_pSectionSet.get() || pSet == m_pSelectionSet.get();
    m_pTabPage->ShowBalance(bIsSection);
    m_pTabPage->SetInSection(bIsSection);
    m_pTabPage->SetFrameMode(true);
    m_pTabPage->SetPageWidth(nWidth);
    m_xTabPage->ShowBalance(bIsSection);
    m_xTabPage->SetInSection(bIsSection);
    m_xTabPage->SetFrameMode(true);
    m_xTabPage->SetPageWidth(nWidth);
    if( pSet )
        m_pTabPage->Reset(pSet);
        m_xTabPage->Reset(pSet);
}

IMPL_LINK_NOARG(SwColumnDlg, OkHdl, weld::Button&, void)
{
    // evaluate current selection
    SfxItemSet* pSet = EvalCurrentSelection();
    m_pTabPage->FillItemSet(pSet);
    m_xTabPage->FillItemSet(pSet);

    if(m_pSelectionSet && SfxItemState::SET == m_pSelectionSet->GetItemState(RES_COL))
    {
@@ -511,11 +510,6 @@ SwColumnPage::SwColumnPage(TabPageParent pParent, const SfxItemSet &rSet)

SwColumnPage::~SwColumnPage()
{
    disposeOnce();
}

void SwColumnPage::dispose()
{
    m_xFrameExampleWN.reset();
    m_xPgeExampleWN.reset();
    m_xDefaultVS.reset();
@@ -527,7 +521,6 @@ void SwColumnPage::dispose()
    m_xLineTypeDLB.reset();
    m_xLineColorDLB.reset();
    m_xTextDirectionLB.reset();
    SfxTabPage::dispose();
}

void SwColumnPage::SetPageWidth(long nPageWidth)
@@ -605,9 +598,9 @@ void SwColumnPage::Reset(const SfxItemSet *rSet)
}

// create TabPage
VclPtr<SfxTabPage> SwColumnPage::Create(TabPageParent pParent, const SfxItemSet *rSet)
std::unique_ptr<SfxTabPage> SwColumnPage::Create(TabPageParent pParent, const SfxItemSet *rSet)
{
    return VclPtr<SwColumnPage>::Create(pParent, *rSet);
    return std::make_unique<SwColumnPage>(pParent, *rSet);
}

// stuff attributes into the Set when OK
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index c721285..9add396 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -717,7 +717,6 @@ SwFramePage::SwFramePage(TabPageParent pParent, const SfxItemSet &rSet)

SwFramePage::~SwFramePage()
{
    disposeOnce();
}

namespace
@@ -821,9 +820,9 @@ void SwFramePage::setOptimalRelWidth()
    m_xHoriRelationLB->clear();
}

VclPtr<SfxTabPage> SwFramePage::Create(TabPageParent pParent, const SfxItemSet *rSet)
std::unique_ptr<SfxTabPage> SwFramePage::Create(TabPageParent pParent, const SfxItemSet *rSet)
{
    return VclPtr<SwFramePage>::Create(pParent, *rSet);
    return std::make_unique<SwFramePage>(pParent, *rSet);
}

void SwFramePage::EnableGraficMode()
@@ -911,9 +910,9 @@ void SwFramePage::Reset( const SfxItemSet *rSet )
        else
        {
            if ( m_bNew )
                SetText(SwResId(STR_FRMUI_OLE_INSERT));
                SetPageTitle(SwResId(STR_FRMUI_OLE_INSERT));
            else
                SetText(SwResId(STR_FRMUI_OLE_EDIT));
                SetPageTitle(SwResId(STR_FRMUI_OLE_EDIT));
        }
    }
    else
@@ -2319,20 +2318,14 @@ SwGrfExtPage::SwGrfExtPage(TabPageParent pParent, const SfxItemSet &rSet)

SwGrfExtPage::~SwGrfExtPage()
{
    disposeOnce();
}

void SwGrfExtPage::dispose()
{
    m_xBmpWin.reset();
    m_xCtlAngle.reset();
    m_xGrfDlg.reset();
    SfxTabPage::dispose();
}

VclPtr<SfxTabPage> SwGrfExtPage::Create(TabPageParent pParent, const SfxItemSet *rSet)
std::unique_ptr<SfxTabPage> SwGrfExtPage::Create(TabPageParent pParent, const SfxItemSet *rSet)
{
    return VclPtr<SwGrfExtPage>::Create(pParent, *rSet);
    return std::make_unique<SwGrfExtPage>(pParent, *rSet);
}

void SwGrfExtPage::Reset(const SfxItemSet *rSet)
@@ -2679,7 +2672,6 @@ SwFrameURLPage::SwFrameURLPage(TabPageParent pParent, const SfxItemSet &rSet)

SwFrameURLPage::~SwFrameURLPage()
{
    disposeOnce();
}

void SwFrameURLPage::Reset( const SfxItemSet *rSet )
@@ -2755,15 +2747,15 @@ bool SwFrameURLPage::FillItemSet(SfxItemSet *rSet)
    return bModified;
}

VclPtr<SfxTabPage> SwFrameURLPage::Create(TabPageParent pParent, const SfxItemSet *rSet)
std::unique_ptr<SfxTabPage> SwFrameURLPage::Create(TabPageParent pParent, const SfxItemSet *rSet)
{
    return VclPtr<SwFrameURLPage>::Create(pParent, *rSet);
    return std::make_unique<SwFrameURLPage>(pParent, *rSet);
}

IMPL_LINK_NOARG(SwFrameURLPage, InsertFileHdl, weld::Button&, void)
{
    FileDialogHelper aDlgHelper(ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
                                FileDialogFlags::NONE, GetFrameWeld());
                                FileDialogFlags::NONE, GetDialogFrameWeld());
    uno::Reference < ui::dialogs::XFilePicker3 > xFP = aDlgHelper.GetFilePicker();

    try
@@ -2819,18 +2811,12 @@ SwFrameAddPage::SwFrameAddPage(TabPageParent pParent, const SfxItemSet &rSet)

SwFrameAddPage::~SwFrameAddPage()
{
    disposeOnce();
}

void SwFrameAddPage::dispose()
{
    m_xTextFlowLB.reset();
    SfxTabPage::dispose();
}

VclPtr<SfxTabPage> SwFrameAddPage::Create(TabPageParent pParent, const SfxItemSet *rSet)
std::unique_ptr<SfxTabPage> SwFrameAddPage::Create(TabPageParent pParent, const SfxItemSet *rSet)
{
    return VclPtr<SwFrameAddPage>::Create(pParent, *rSet);
    return std::make_unique<SwFrameAddPage>(pParent, *rSet);
}

void SwFrameAddPage::Reset(const SfxItemSet *rSet )
diff --git a/sw/source/ui/frmdlg/uiborder.cxx b/sw/source/ui/frmdlg/uiborder.cxx
index 9db98fd..06d99bb 100644
--- a/sw/source/ui/frmdlg/uiborder.cxx
+++ b/sw/source/ui/frmdlg/uiborder.cxx
@@ -40,13 +40,13 @@ SwBorderDlg::SwBorderDlg(weld::Window* pParent, SfxItemSet& rSet, SwBorderModes 
    if (fnCreatePage)
    {
        TabPageParent pPageParent(get_content_area(), this);
        VclPtr<SfxTabPage> xNewPage = (*fnCreatePage)(pPageParent, &rSet);
        std::unique_ptr<SfxTabPage> xNewPage = (*fnCreatePage)(pPageParent, &rSet);
        SfxAllItemSet aSet(*(rSet.GetPool()));
        aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE, static_cast<sal_uInt16>(nType)));
        if(SwBorderModes::TABLE == nType)
            aSet.Put (SfxUInt32Item(SID_FLAG_TYPE,SVX_HIDESHADOWCTL));
        xNewPage->PageCreated(aSet);
        SetTabPage(xNewPage);
        SetTabPage(std::move(xNewPage));
    }
}

diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx
index 99d9ad7..3b3f590 100644
--- a/sw/source/ui/frmdlg/wrap.cxx
+++ b/sw/source/ui/frmdlg/wrap.cxx
@@ -59,10 +59,11 @@ SwWrapDlg::SwWrapDlg(weld::Window* pParent, SfxItemSet& rSet, SwWrtShell* pWrtSh
{
    // create TabPage
    TabPageParent pPageParent(get_content_area(), this);
    VclPtr<SwWrapTabPage> xNewPage = static_cast<SwWrapTabPage*>(SwWrapTabPage::Create(pPageParent, &rSet).get());
    xNewPage->SetFormatUsed(false, bDrawMode);
    xNewPage->SetShell(pWrtShell);
    SetTabPage(xNewPage);
    auto xNewPage = SwWrapTabPage::Create(pPageParent, &rSet);
    SwWrapTabPage* pWrapPage = static_cast<SwWrapTabPage*>(xNewPage.get());
    pWrapPage->SetFormatUsed(false, bDrawMode);
    pWrapPage->SetShell(pWrtShell);
    SetTabPage(std::move(xNewPage));
}

SwWrapTabPage::SwWrapTabPage(TabPageParent pParent, const SfxItemSet &rSet)
@@ -114,9 +115,9 @@ SwWrapTabPage::~SwWrapTabPage()
{
}

VclPtr<SfxTabPage> SwWrapTabPage::Create(TabPageParent pParent, const SfxItemSet *rSet)
std::unique_ptr<SfxTabPage> SwWrapTabPage::Create(TabPageParent pParent, const SfxItemSet *rSet)
{
    return VclPtr<SwWrapTabPage>::Create(pParent, *rSet);
    return std::make_unique<SwWrapTabPage>(pParent, *rSet);
}

void SwWrapTabPage::Reset(const SfxItemSet *rSet)
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index d852753..a23cf50 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -808,15 +808,9 @@ SwTOXSelectTabPage::SwTOXSelectTabPage(TabPageParent pParent, const SfxItemSet& 

SwTOXSelectTabPage::~SwTOXSelectTabPage()
{
    disposeOnce();
}

void SwTOXSelectTabPage::dispose()
{
    pIndexRes.reset();
    pIndexEntryWrapper.reset();
    m_xLanguageLB.reset();
    SfxTabPage::dispose();
}

void SwTOXSelectTabPage::SetWrtShell(SwWrtShell const & rSh)
@@ -1179,9 +1173,9 @@ DeactivateRC SwTOXSelectTabPage::DeactivatePage(SfxItemSet* _pSet)
    return DeactivateRC::LeavePage;
}

VclPtr<SfxTabPage> SwTOXSelectTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
std::unique_ptr<SfxTabPage> SwTOXSelectTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
{
    return VclPtr<SwTOXSelectTabPage>::Create(pParent, *rAttrSet);
    return std::make_unique<SwTOXSelectTabPage>(pParent, *rAttrSet);
}

IMPL_LINK(SwTOXSelectTabPage, TOXTypeHdl, weld::ComboBox&, rBox, void)
@@ -1915,13 +1909,7 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(TabPageParent pParent, const SfxItemSet& rA

SwTOXEntryTabPage::~SwTOXEntryTabPage()
{
    disposeOnce();
}

void SwTOXEntryTabPage::dispose()
{
    m_xTokenWIN.reset();
    SfxTabPage::dispose();
}

IMPL_LINK_NOARG(SwTOXEntryTabPage, ModifyClickHdl, weld::ToggleButton&, void)
@@ -2124,9 +2112,9 @@ DeactivateRC SwTOXEntryTabPage::DeactivatePage( SfxItemSet* /*pSet*/)
    return DeactivateRC::LeavePage;
}

VclPtr<SfxTabPage> SwTOXEntryTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
std::unique_ptr<SfxTabPage> SwTOXEntryTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
{
    return VclPtr<SwTOXEntryTabPage>::Create(pParent, *rAttrSet);
    return std::make_unique<SwTOXEntryTabPage>(pParent, *rAttrSet);
}

IMPL_LINK_NOARG(SwTOXEntryTabPage, EditStyleHdl, weld::Button&, void)
@@ -3471,10 +3459,10 @@ DeactivateRC SwTOXStylesTabPage::DeactivatePage( SfxItemSet* /*pSet*/  )
    return DeactivateRC::LeavePage;
}

VclPtr<SfxTabPage> SwTOXStylesTabPage::Create(TabPageParent pParent,
std::unique_ptr<SfxTabPage> SwTOXStylesTabPage::Create(TabPageParent pParent,
                                              const SfxItemSet* rAttrSet)
{
    return VclPtr<SwTOXStylesTabPage>::Create(pParent, *rAttrSet);
    return std::make_unique<SwTOXStylesTabPage>(pParent, *rAttrSet);
}

IMPL_LINK_NOARG(SwTOXStylesTabPage, EditStyleHdl, weld::Button&, void)
diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx
index c8512fa..081ad7f 100644
--- a/sw/source/ui/misc/docfnote.cxx
+++ b/sw/source/ui/misc/docfnote.cxx
@@ -105,7 +105,6 @@ SwEndNoteOptionPage::SwEndNoteOptionPage(TabPageParent pParent, bool bEN,

SwEndNoteOptionPage::~SwEndNoteOptionPage()
{
    disposeOnce();
}

void SwEndNoteOptionPage::Reset( const SfxItemSet* )
@@ -210,9 +209,9 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet* )
    m_xPageTemplBox->set_active_text(pInf->GetPageDesc(*pSh->GetDoc())->GetName());
}

VclPtr<SfxTabPage> SwEndNoteOptionPage::Create( TabPageParent pParent, const SfxItemSet *rSet )
std::unique_ptr<SfxTabPage> SwEndNoteOptionPage::Create( TabPageParent pParent, const SfxItemSet *rSet )
{
    return VclPtr<SwEndNoteOptionPage>::Create(pParent, true, *rSet);
    return std::make_unique<SwEndNoteOptionPage>(pParent, true, *rSet);
}

// Different kinds of numbering; because the Listbox has varying numbers of
@@ -379,9 +378,9 @@ SwFootNoteOptionPage::~SwFootNoteOptionPage()
{
}

VclPtr<SfxTabPage> SwFootNoteOptionPage::Create(TabPageParent pParent, const SfxItemSet *rSet )
std::unique_ptr<SfxTabPage> SwFootNoteOptionPage::Create(TabPageParent pParent, const SfxItemSet *rSet )
{
    return VclPtr<SwFootNoteOptionPage>::Create(pParent, *rSet);
    return std::make_unique<SwFootNoteOptionPage>(pParent, *rSet);
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/impfnote.hxx b/sw/source/ui/misc/impfnote.hxx
index fba53a2..fb02e57 100644
--- a/sw/source/ui/misc/impfnote.hxx
+++ b/sw/source/ui/misc/impfnote.hxx
@@ -64,7 +64,7 @@ public:
    SwEndNoteOptionPage(TabPageParent pParent, bool bEndNote, const SfxItemSet &rSet);
    virtual ~SwEndNoteOptionPage() override;

    static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet);
    virtual bool FillItemSet(SfxItemSet *rSet) override;
    virtual void Reset( const SfxItemSet* ) override;

@@ -73,12 +73,10 @@ public:

class SwFootNoteOptionPage : public SwEndNoteOptionPage
{
    friend class VclPtr<SwFootNoteOptionPage>;
    SwFootNoteOptionPage(TabPageParent pParent, const SfxItemSet &rSet );
    virtual ~SwFootNoteOptionPage() override;

public:
    static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet);
    SwFootNoteOptionPage(TabPageParent pParent, const SfxItemSet &rSet );
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet);
    virtual ~SwFootNoteOptionPage() override;
};

#endif
diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index 20c7468..a11e639 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -136,14 +136,8 @@ SwNumPositionTabPage::SwNumPositionTabPage(TabPageParent pParent, const SfxItemS

SwNumPositionTabPage::~SwNumPositionTabPage()
{
    disposeOnce();
}

void SwNumPositionTabPage::dispose()
{
    pActNum.reset();
    pOutlineDlg = nullptr;
    SfxTabPage::dispose();
}

void SwNumPositionTabPage::InitControls()
@@ -497,10 +491,10 @@ void SwNumPositionTabPage::ShowControlsDependingOnPosAndSpaceMode()
    m_xIndentAtMF->set_visible( bLabelAlignmentPosAndSpaceModeActive );
}

VclPtr<SfxTabPage> SwNumPositionTabPage::Create( TabPageParent pParent,
std::unique_ptr<SfxTabPage> SwNumPositionTabPage::Create( TabPageParent pParent,
                                                 const SfxItemSet* rAttrSet)
{
    return VclPtr<SwNumPositionTabPage>::Create(pParent, *rAttrSet);
    return std::make_unique<SwNumPositionTabPage>(pParent, *rAttrSet);
}

void SwNumPositionTabPage::SetWrtShell(SwWrtShell* pSh)
diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index b7b760a..88353b9 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -801,10 +801,10 @@ void SwOutlineSettingsTabPage::Reset( const SfxItemSet* rSet )
    ActivatePage(*rSet);
}

VclPtr<SfxTabPage> SwOutlineSettingsTabPage::Create(TabPageParent pParent,
std::unique_ptr<SfxTabPage> SwOutlineSettingsTabPage::Create(TabPageParent pParent,
                                                    const SfxItemSet* rAttrSet)
{
    return VclPtr<SwOutlineSettingsTabPage>::Create(pParent, *rAttrSet);
    return std::make_unique<SwOutlineSettingsTabPage>(pParent, *rAttrSet);
}

void SwOutlineSettingsTabPage::CheckForStartValue_Impl(sal_uInt16 nNumberingType)
diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx
index 0a93846..e4004b3 100644
--- a/sw/source/ui/misc/pgfnote.cxx
+++ b/sw/source/ui/misc/pgfnote.cxx
@@ -131,19 +131,13 @@ SwFootNotePage::SwFootNotePage(TabPageParent pParent, const SfxItemSet &rSet)

SwFootNotePage::~SwFootNotePage()
{
    disposeOnce();
}

void SwFootNotePage::dispose()
{
    m_xLineColorBox.reset();
    m_xLineTypeBox.reset();
    SfxTabPage::dispose();
}

VclPtr<SfxTabPage> SwFootNotePage::Create(TabPageParent pParent, const SfxItemSet *rSet)
std::unique_ptr<SfxTabPage> SwFootNotePage::Create(TabPageParent pParent, const SfxItemSet *rSet)
{
    return VclPtr<SwFootNotePage>::Create(pParent, *rSet);
    return std::make_unique<SwFootNotePage>(pParent, *rSet);
}

void SwFootNotePage::Reset(const SfxItemSet *rSet)
diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx
index 860f913..33455026 100644
--- a/sw/source/ui/misc/pggrid.cxx
+++ b/sw/source/ui/misc/pggrid.cxx
@@ -126,18 +126,12 @@ SwTextGridPage::SwTextGridPage(TabPageParent pParent, const SfxItemSet &rSet)

SwTextGridPage::~SwTextGridPage()
{
    disposeOnce();
}

void SwTextGridPage::dispose()
{
    m_xColorLB.reset();
    SfxTabPage::dispose();
}

VclPtr<SfxTabPage> SwTextGridPage::Create(TabPageParent pParent, const SfxItemSet *rSet)
std::unique_ptr<SfxTabPage> SwTextGridPage::Create(TabPageParent pParent, const SfxItemSet *rSet)
{
    return VclPtr<SwTextGridPage>::Create(pParent, *rSet);
    return std::make_unique<SwTextGridPage>(pParent, *rSet);
}

bool SwTextGridPage::FillItemSet(SfxItemSet *rSet)
diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index 1871d74..a990769 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -366,9 +366,9 @@ void  SwFormatTablePage::ModifyHdl(const weld::MetricSpinButton& rEdit)
    bModified = true;
}

VclPtr<SfxTabPage> SwFormatTablePage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
std::unique_ptr<SfxTabPage> SwFormatTablePage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
{
    return VclPtr<SwFormatTablePage>::Create(pParent, *rAttrSet);
    return std::make_unique<SwFormatTablePage>(pParent, *rAttrSet);
}

bool  SwFormatTablePage::FillItemSet( SfxItemSet* rCoreSet )
@@ -767,22 +767,16 @@ IMPL_LINK_NOARG(SwTableColumnPage, SizeHdl, void*, void)

SwTableColumnPage::~SwTableColumnPage()
{
    disposeOnce();
}

void SwTableColumnPage::dispose()
{
    if (m_pSizeHdlEvent)
    {
        Application::RemoveUserEvent(m_pSizeHdlEvent);
        m_pSizeHdlEvent = nullptr;
    }
    SfxTabPage::dispose();
}

VclPtr<SfxTabPage> SwTableColumnPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
std::unique_ptr<SfxTabPage> SwTableColumnPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet)
{
    return VclPtr<SwTableColumnPage>::Create(pParent, *rAttrSet);
    return std::make_unique<SwTableColumnPage>(pParent, *rAttrSet);
}

void  SwTableColumnPage::Reset( const SfxItemSet* )
@@ -1286,10 +1280,10 @@ SwTextFlowPage::~SwTextFlowPage()
{
}

VclPtr<SfxTabPage> SwTextFlowPage::Create( TabPageParent pParent,
                                           const SfxItemSet* rAttrSet)
std::unique_ptr<SfxTabPage> SwTextFlowPage::Create(TabPageParent pParent,
                                                   const SfxItemSet* rAttrSet)
{
    return VclPtr<SwTextFlowPage>::Create(pParent, *rAttrSet);
    return std::make_unique<SwTextFlowPage>(pParent, *rAttrSet);
}

bool  SwTextFlowPage::FillItemSet( SfxItemSet* rSet )
diff --git a/sw/source/uibase/app/appopt.cxx b/sw/source/uibase/app/appopt.cxx
index b650846..196465f 100644
--- a/sw/source/uibase/app/appopt.cxx
+++ b/sw/source/uibase/app/appopt.cxx
@@ -404,9 +404,9 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
    ApplyUsrPref( aViewOpt, pAppView, bTextDialog? SvViewOpt::DestText : SvViewOpt::DestWeb);
}

VclPtr<SfxTabPage> SwModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet )
std::unique_ptr<SfxTabPage> SwModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet )
{
    VclPtr<SfxTabPage> pRet;
    std::unique_ptr<SfxTabPage> xRet;
    SfxAllItemSet aSet(*(rSet.GetPool()));
    switch( nId )
    {
@@ -415,12 +415,12 @@ VclPtr<SfxTabPage> SwModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParen
        {
            SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
            ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
            pRet = (*fnCreatePage)( pParent, &rSet );
            xRet = (*fnCreatePage)( pParent, &rSet );
            break;
        }
        case RID_SW_TP_HTML_OPTGRID_PAGE:
        case RID_SVXPAGE_GRID:
            pRet = SvxGridTabPage::Create(pParent, rSet);
            xRet = SvxGridTabPage::Create(pParent, rSet);
        break;

        case RID_SW_TP_STD_FONT:
@@ -429,11 +429,11 @@ VclPtr<SfxTabPage> SwModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParen
        {
            SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
            ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
            pRet = (*fnCreatePage)( pParent, &rSet );
            xRet = (*fnCreatePage)( pParent, &rSet );
            if(RID_SW_TP_STD_FONT != nId)
            {
                aSet.Put (SfxUInt16Item(SID_FONTMODE_TYPE, RID_SW_TP_STD_FONT_CJK == nId ? FONT_GROUP_CJK : FONT_GROUP_CTL));
                pRet->PageCreated(aSet);
                xRet->PageCreated(aSet);
            }
        }
        break;
@@ -442,9 +442,9 @@ VclPtr<SfxTabPage> SwModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParen
        {
            SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
            ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
            pRet = (*fnCreatePage)( pParent, &rSet );
            xRet = (*fnCreatePage)( pParent, &rSet );
            aSet.Put (SfxBoolItem(SID_FAX_LIST, true));
            pRet->PageCreated(aSet);
            xRet->PageCreated(aSet);
        }
        break;
        case RID_SW_TP_HTML_OPTTABLE_PAGE:
@@ -452,7 +452,7 @@ VclPtr<SfxTabPage> SwModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParen
        {
            SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
            ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
            pRet = (*fnCreatePage)( pParent, &rSet );
            xRet = (*fnCreatePage)( pParent, &rSet );
            SwView* pCurrView = GetView();
            if(pCurrView)
            {
@@ -462,7 +462,7 @@ VclPtr<SfxTabPage> SwModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParen
                    (!bWebView &&  RID_SW_TP_HTML_OPTTABLE_PAGE != nId) )
                {
                    aSet.Put (SwWrtShellItem(pCurrView->GetWrtShellPtr()));
                    pRet->PageCreated(aSet);
                    xRet->PageCreated(aSet);
                }
            }
        }
@@ -477,14 +477,14 @@ VclPtr<SfxTabPage> SwModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParen
        {
            SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
            ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
            pRet = (*fnCreatePage)( pParent, &rSet );
            xRet = (*fnCreatePage)( pParent, &rSet );
            if (nId == RID_SW_TP_OPTSHDWCRSR || nId == RID_SW_TP_HTML_OPTSHDWCRSR)
            {
                SwView* pCurrView = GetView();
                if(pCurrView)
                {
                    aSet.Put( SwWrtShellItem( pCurrView->GetWrtShellPtr() ) );
                    pRet->PageCreated(aSet);
                    xRet->PageCreated(aSet);
                }
            }
        }
@@ -493,28 +493,28 @@ VclPtr<SfxTabPage> SwModule::CreateTabPage( sal_uInt16 nId, TabPageParent pParen
        {
            SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
            ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
            pRet = (*fnCreatePage)( pParent, &rSet );
            xRet = (*fnCreatePage)( pParent, &rSet );
            break;
        }
        case  RID_SW_TP_BACKGROUND:
        {
            SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
            ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND );
            pRet = (*fnCreatePage)( pParent, &rSet );
            xRet = (*fnCreatePage)( pParent, &rSet );
            break;
        }
        case RID_SW_TP_OPTCAPTION_PAGE:
        {
            SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
            ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SW_TP_OPTCAPTION_PAGE );
            pRet = (*fnCreatePage)( pParent, &rSet );
            xRet = (*fnCreatePage)( pParent, &rSet );
        }
        break;
    }

    if(!pRet)
    if(!xRet)
        SAL_WARN( "sw", "SwModule::CreateTabPage(): Unknown tabpage id " << nId );
    return pRet;
    return xRet;
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/inc/chrdlg.hxx b/sw/source/uibase/inc/chrdlg.hxx
index 5b20909..58067ee 100644
--- a/sw/source/uibase/inc/chrdlg.hxx
+++ b/sw/source/uibase/inc/chrdlg.hxx
@@ -62,8 +62,7 @@ public:
    SwCharURLPage(TabPageParent pParent, const SfxItemSet& rSet);

    virtual ~SwCharURLPage() 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;
diff --git a/sw/source/uibase/inc/column.hxx b/sw/source/uibase/inc/column.hxx
index 427c802..8b339c8 100644
--- a/sw/source/uibase/inc/column.hxx
+++ b/sw/source/uibase/inc/column.hxx
@@ -37,7 +37,7 @@ class SwColumnPage;
class SwColumnDlg : public SfxDialogController
{
    SwWrtShell&         m_rWrtShell;
    VclPtr<SwColumnPage>       m_pTabPage;
    std::unique_ptr<SwColumnPage> m_xTabPage;
    std::unique_ptr<SfxItemSet> m_pPageSet;
    std::unique_ptr<SfxItemSet> m_pSectionSet;
    std::unique_ptr<SfxItemSet> m_pSelectionSet;
@@ -158,9 +158,6 @@ class SwColumnPage : public SfxTabPage
    void            ResetColWidth();
    void            SetLabels( sal_uInt16 nVis );

    using SfxTabPage::ActivatePage;
    using SfxTabPage::DeactivatePage;

    virtual void    ActivatePage(const SfxItemSet& rSet) override;
    virtual DeactivateRC   DeactivatePage(SfxItemSet *pSet) override;

@@ -173,9 +170,8 @@ class SwColumnPage : public SfxTabPage
public:
    SwColumnPage(TabPageParent pParent, const SfxItemSet &rSet);
    virtual ~SwColumnPage() 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);
    static const sal_uInt16* GetRanges() { return aPageRg; }

    virtual bool    FillItemSet(SfxItemSet *rSet) override;
diff --git a/sw/source/uibase/inc/docstdlg.hxx b/sw/source/uibase/inc/docstdlg.hxx
index 7ffbccc..86c4a01 100644
--- a/sw/source/uibase/inc/docstdlg.hxx
+++ b/sw/source/uibase/inc/docstdlg.hxx
@@ -29,7 +29,7 @@ public:
    SwDocStatPage(TabPageParent pParent, const SfxItemSet &rSet);
    virtual ~SwDocStatPage() override;

    static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet);

private:
    virtual bool    FillItemSet(      SfxItemSet *rSet) override;
diff --git a/sw/source/uibase/inc/drpcps.hxx b/sw/source/uibase/inc/drpcps.hxx
index 454385a..140f433 100644
--- a/sw/source/uibase/inc/drpcps.hxx
+++ b/sw/source/uibase/inc/drpcps.hxx
@@ -38,7 +38,7 @@ class SwDropCapsPage;

class SwDropCapsPict : public weld::CustomWidgetController
{
    VclPtr<SwDropCapsPage> mpPage;
    SwDropCapsPage* mpPage;
    OUString        maText;
    OUString        maScriptText;
    Color           maBackColor;
@@ -144,16 +144,13 @@ friend class SwDropCapsPict;
    DECL_LINK(SelectHdl, weld::ComboBox&, void);
    DECL_LINK(WholeWordHdl, weld::ToggleButton&, void);

    using SfxTabPage::ActivatePage;
    using SfxTabPage::DeactivatePage;

    static const sal_uInt16 aPageRg[];

public:
    SwDropCapsPage(TabPageParent pParent, const SfxItemSet &rSet);
    virtual ~SwDropCapsPage() override;

    static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet);
    static const sal_uInt16* GetRanges() { return aPageRg; }


diff --git a/sw/source/uibase/inc/envlop.hxx b/sw/source/uibase/inc/envlop.hxx
index 04686af..d62fd85 100644
--- a/sw/source/uibase/inc/envlop.hxx
+++ b/sw/source/uibase/inc/envlop.hxx
@@ -103,15 +103,12 @@ class SwEnvPage : public SfxTabPage

    SwEnvDlg* GetParentSwEnvDlg() { return m_pDialog; }

    using SfxTabPage::ActivatePage;
    using SfxTabPage::DeactivatePage;

public:
    SwEnvPage(TabPageParent pParent, const SfxItemSet& rSet);
    void Init(SwEnvDlg* pDialog);
    virtual ~SwEnvPage() override;

    static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rSet);

    virtual void ActivatePage(const SfxItemSet& rSet) override;
    virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override;
diff --git a/sw/source/uibase/inc/fldedt.hxx b/sw/source/uibase/inc/fldedt.hxx
index c10cda5..9f512ea 100644
--- a/sw/source/uibase/inc/fldedt.hxx
+++ b/sw/source/uibase/inc/fldedt.hxx
@@ -38,7 +38,7 @@ class SwFieldEditDlg : public SfxSingleTabDialogController
    DECL_LINK(NextPrevHdl, weld::Button&, void);

    void            Init();
    VclPtr<SfxTabPage> CreatePage(sal_uInt16 nGroup);
    SfxTabPage* CreatePage(sal_uInt16 nGroup);

    void EnsureSelection(SwField *pCurField, SwFieldMgr &rMgr);
public:
diff --git a/sw/source/uibase/inc/frmpage.hxx b/sw/source/uibase/inc/frmpage.hxx
index 8e89292..34c76fa 100644
--- a/sw/source/uibase/inc/frmpage.hxx
+++ b/sw/source/uibase/inc/frmpage.hxx
@@ -173,16 +173,13 @@ class SwFramePage: public SfxTabPage

    SwWrtShell *getFrameDlgParentShell();

    using SfxTabPage::ActivatePage;
    using SfxTabPage::DeactivatePage;

    static const sal_uInt16 aPageRg[];

public:
    SwFramePage(TabPageParent pParent, const SfxItemSet &rSet);
    virtual ~SwFramePage() override;

    static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet);
    static const sal_uInt16* GetRanges() { return aPageRg; }

    virtual bool FillItemSet(SfxItemSet *rSet) override;
@@ -230,16 +227,11 @@ class SwGrfExtPage : public SfxTabPage
    DECL_LINK(BrowseHdl, weld::Button&, void);

    virtual void    ActivatePage(const SfxItemSet& rSet) override;
    virtual ~SwGrfExtPage() override;
    virtual void dispose() override;

    using SfxTabPage::ActivatePage;
    using SfxTabPage::DeactivatePage;

public:
    SwGrfExtPage(TabPageParent pParent, const SfxItemSet &rSet);

    static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet);
    virtual ~SwGrfExtPage() override;

    virtual bool FillItemSet(SfxItemSet *rSet) override;
    virtual void Reset(const SfxItemSet *rSet) override;
@@ -260,14 +252,11 @@ class SwFrameURLPage : public SfxTabPage

    DECL_LINK(InsertFileHdl, weld::Button&, void);

    using SfxTabPage::ActivatePage;
    using SfxTabPage::DeactivatePage;

public:
    SwFrameURLPage(TabPageParent pParent, const SfxItemSet &rSet);
    virtual ~SwFrameURLPage() 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;
@@ -316,9 +305,8 @@ class SwFrameAddPage : public SfxTabPage
public:
    SwFrameAddPage(TabPageParent pParent, const SfxItemSet &rSet);
    virtual ~SwFrameAddPage() 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);
    static const sal_uInt16*  GetRanges() { return aAddPgRg; }

    virtual bool FillItemSet(SfxItemSet *rSet) override;
diff --git a/sw/source/uibase/inc/label.hxx b/sw/source/uibase/inc/label.hxx
index b014e40..463f4e3 100644
--- a/sw/source/uibase/inc/label.hxx
+++ b/sw/source/uibase/inc/label.hxx
@@ -33,7 +33,7 @@ class SwLabDlg : public SfxTabDialogController
{
    SwLabelConfig   aLabelsCfg;
    SwDBManager* const     pDBManager;
    VclPtr<SwLabPrtPage>   pPrtPage;
    SwLabPrtPage* m_pPrtPage;

    std::vector<sal_uInt16> aTypeIds;
    std::vector<OUString> aMakes;
diff --git a/sw/source/uibase/inc/mailconfigpage.hxx b/sw/source/uibase/inc/mailconfigpage.hxx
index f883b41..6515892 100644
--- a/sw/source/uibase/inc/mailconfigpage.hxx
+++ b/sw/source/uibase/inc/mailconfigpage.hxx
@@ -50,9 +50,8 @@ class SwMailConfigPage : public SfxTabPage
public:
    SwMailConfigPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual ~SwMailConfigPage() 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;
diff --git a/sw/source/uibase/inc/mailmergewizard.hxx b/sw/source/uibase/inc/mailmergewizard.hxx
index 3b1e332..cac0942 100644
--- a/sw/source/uibase/inc/mailmergewizard.hxx
+++ b/sw/source/uibase/inc/mailmergewizard.hxx
@@ -54,7 +54,7 @@ class SwMailMergeWizard : public ::vcl::RoadmapWizardMachine
    using vcl::WizardMachine::skipUntil;

protected:
    virtual VclPtr<TabPage>         createPage( WizardState _nState ) override;
    virtual std::unique_ptr<BuilderPage> createPage( WizardState _nState ) override;
    virtual void                    enterState( WizardState _nState ) override;

    virtual OUString                getStateDisplayName( WizardState _nState ) const override;
diff --git a/sw/source/uibase/inc/num.hxx b/sw/source/uibase/inc/num.hxx
index dcd92d8..ed1844f 100644
--- a/sw/source/uibase/inc/num.hxx
+++ b/sw/source/uibase/inc/num.hxx
@@ -90,21 +90,17 @@ class SwNumPositionTabPage : public SfxTabPage
    DECL_LINK(AlignAtHdl_Impl, weld::MetricSpinButton&, void);
    DECL_LINK(IndentAtHdl_Impl, weld::MetricSpinButton&, void);

    using SfxTabPage::ActivatePage;
    using SfxTabPage::DeactivatePage;

public:

    SwNumPositionTabPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual ~SwNumPositionTabPage() 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                SetOutlineTabDialog(SwOutlineTabDialog* pDlg){pOutlineDlg = pDlg;}
diff --git a/sw/source/uibase/inc/numpara.hxx b/sw/source/uibase/inc/numpara.hxx
index 44dab6a..fe2d66e 100644
--- a/sw/source/uibase/inc/numpara.hxx
+++ b/sw/source/uibase/inc/numpara.hxx
@@ -65,7 +65,7 @@ public:
    SwParagraphNumTabPage(TabPageParent pParent, const SfxItemSet& rSet );
    virtual ~SwParagraphNumTabPage() override;

    static VclPtr<SfxTabPage> Create( TabPageParent pParent,
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent,
                                      const SfxItemSet* rSet );
    static const sal_uInt16* GetRanges() { return aPageRg; }

diff --git a/sw/source/uibase/inc/optcomp.hxx b/sw/source/uibase/inc/optcomp.hxx
index c153a4d..e19f10f 100644
--- a/sw/source/uibase/inc/optcomp.hxx
+++ b/sw/source/uibase/inc/optcomp.hxx
@@ -68,7 +68,7 @@ public:
    SwCompatibilityOptPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual ~SwCompatibilityOptPage() override;

    static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet );
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet );

    virtual bool            FillItemSet( SfxItemSet* rSet ) override;
    virtual void            Reset( const SfxItemSet* rSet ) override;
diff --git a/sw/source/uibase/inc/optload.hxx b/sw/source/uibase/inc/optload.hxx
index d277a4d..2c3461e 100644
--- a/sw/source/uibase/inc/optload.hxx
+++ b/sw/source/uibase/inc/optload.hxx
@@ -84,7 +84,7 @@ public:
    SwLoadOptPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual ~SwLoadOptPage() override;

    static VclPtr<SfxTabPage> Create( TabPageParent pParent,
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent,
                                      const SfxItemSet* rAttrSet);

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
@@ -185,9 +185,8 @@ private:
public:
    SwCaptionOptPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual ~SwCaptionOptPage() 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;
diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx
index f6ef68d..2778ea6 100644
--- a/sw/source/uibase/inc/optpage.hxx
+++ b/sw/source/uibase/inc/optpage.hxx
@@ -62,7 +62,7 @@ public:
    SwContentOptPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual ~SwContentOptPage() 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;
@@ -106,7 +106,7 @@ public:
    SwAddPrinterTabPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual ~SwAddPrinterTabPage() 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;
@@ -117,7 +117,6 @@ public:

class SwStdFontTabPage : public SfxTabPage
{
    friend class VclPtr<SwStdFontTabPage>;
    OUString m_sShellStd;
    OUString m_sShellTitle;
    OUString m_sShellList;
@@ -166,12 +165,10 @@ class SwStdFontTabPage : public SfxTabPage
    DECL_LINK(ModifyHdl, weld::ComboBox&, void );
    DECL_LINK(LoseFocusHdl, weld::Widget&, void );

    SwStdFontTabPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual ~SwStdFontTabPage() override;
    virtual void dispose() override;

public:
    static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet);
    SwStdFontTabPage(TabPageParent pParent, const SfxItemSet& rSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet);
    virtual ~SwStdFontTabPage() override;

    virtual bool FillItemSet(SfxItemSet* rSet) override;
    virtual void Reset(const SfxItemSet* rSet) override;
@@ -209,7 +206,7 @@ public:
    SwTableOptionsTabPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual ~SwTableOptionsTabPage() 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;
@@ -250,7 +247,7 @@ public:
    SwShdwCursorOptionsTabPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual ~SwShdwCursorOptionsTabPage() 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;
@@ -322,9 +319,8 @@ class SwRedlineOptionsTabPage : public SfxTabPage
public:
    SwRedlineOptionsTabPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual ~SwRedlineOptionsTabPage() 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;
@@ -340,7 +336,7 @@ public:
    SwTestTabPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual ~SwTestTabPage() 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;
@@ -381,7 +377,7 @@ public:
    SwCompareOptionsTabPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual ~SwCompareOptionsTabPage() override;

    static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet );
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet );

    virtual bool FillItemSet( SfxItemSet* rSet ) override;
    virtual void Reset( const SfxItemSet* rSet ) override;
diff --git a/sw/source/uibase/inc/outline.hxx b/sw/source/uibase/inc/outline.hxx
index f57ce39..76bc778 100644
--- a/sw/source/uibase/inc/outline.hxx
+++ b/sw/source/uibase/inc/outline.hxx
@@ -98,11 +98,10 @@ class SwOutlineSettingsTabPage : public SfxTabPage
    void    SetModified() { m_aPreviewWIN.Invalidate(); }
    void    CheckForStartValue_Impl(sal_uInt16 nNumberingType);

    using SfxTabPage::ActivatePage;
    using SfxTabPage::DeactivatePage;

public:
    SwOutlineSettingsTabPage(TabPageParent pParent, const SfxItemSet& rSet);
    static std::unique_ptr<SfxTabPage>  Create( TabPageParent pParent,
                                       const SfxItemSet* rAttrSet);
    virtual ~SwOutlineSettingsTabPage() override;

    void SetWrtShell(SwWrtShell* pShell);
@@ -112,8 +111,6 @@ public:

    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;
    static VclPtr<SfxTabPage>  Create( TabPageParent pParent,
                                       const SfxItemSet* rAttrSet);
    void SetNumRule(SwNumRule *pRule)
    {
        pNumRule = pRule;
diff --git a/sw/source/uibase/inc/pgfnote.hxx b/sw/source/uibase/inc/pgfnote.hxx
index 1333672..b74e522 100644
--- a/sw/source/uibase/inc/pgfnote.hxx
+++ b/sw/source/uibase/inc/pgfnote.hxx
@@ -27,18 +27,17 @@
// footnote settings TabPage
class SwFootNotePage: public SfxTabPage
{
    friend class VclPtr<SwFootNotePage>;
    static const sal_uInt16 aPageRg[];
    SwFootNotePage(TabPageParent pParent, const SfxItemSet &rSet);
public:
    static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet);
    SwFootNotePage(TabPageParent pParent, const SfxItemSet &rSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet);
    virtual ~SwFootNotePage() override;

    static const sal_uInt16* GetRanges() { return aPageRg; }

    virtual bool FillItemSet(SfxItemSet *rSet) override;
    virtual void Reset(const SfxItemSet *rSet) override;

    virtual ~SwFootNotePage() override;
    virtual void dispose() override;
private:

    long            lMaxHeight;
@@ -60,9 +59,6 @@ private:
    DECL_LINK(LineWidthChanged_Impl, weld::MetricSpinButton&, void);
    DECL_LINK(LineColorSelected_Impl, ColorListBox&, void);

    using SfxTabPage::ActivatePage;
    using SfxTabPage::DeactivatePage;

    virtual void    ActivatePage( const SfxItemSet& rSet ) override;
    virtual DeactivateRC   DeactivatePage( SfxItemSet* pSet ) override;

diff --git a/sw/source/uibase/inc/pggrid.hxx b/sw/source/uibase/inc/pggrid.hxx
index 9da77f5..826c67f 100644
--- a/sw/source/uibase/inc/pggrid.hxx
+++ b/sw/source/uibase/inc/pggrid.hxx
@@ -72,15 +72,11 @@ class SwTextGridPage: public SfxTabPage
    DECL_LINK(GridModifyClickHdl, weld::ToggleButton&, void);
    DECL_LINK(DisplayGridHdl, weld::ToggleButton&, void);

    using SfxTabPage::ActivatePage;
    using SfxTabPage::DeactivatePage;

public:
    SwTextGridPage(TabPageParent pParent, const SfxItemSet &rSet);
    virtual ~SwTextGridPage() 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);
    static const sal_uInt16* GetRanges();

    virtual bool    FillItemSet(SfxItemSet *rSet) override;
diff --git a/sw/source/uibase/inc/pview.hxx b/sw/source/uibase/inc/pview.hxx
index f338228..4d1414e 100644
--- a/sw/source/uibase/inc/pview.hxx
+++ b/sw/source/uibase/inc/pview.hxx
@@ -201,7 +201,7 @@ class SW_DLLPUBLIC SwPagePreview: public SfxViewShell
    SAL_DLLPRIVATE virtual SfxPrinter*     GetPrinter( bool bCreate = false ) override;
    SAL_DLLPRIVATE virtual sal_uInt16      SetPrinter( SfxPrinter *pNewPrinter, SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL ) override;
    SAL_DLLPRIVATE virtual bool            HasPrintOptionsPage() const override;
    SAL_DLLPRIVATE virtual VclPtr<SfxTabPage> CreatePrintOptionsPage(TabPageParent pParent, const SfxItemSet &rOptions) override;
    SAL_DLLPRIVATE virtual std::unique_ptr<SfxTabPage> CreatePrintOptionsPage(TabPageParent pParent, const SfxItemSet &rOptions) override;

    SAL_DLLPRIVATE void CalcAndSetBorderPixel( SvBorder &rToFill );

diff --git a/sw/source/uibase/inc/regionsw.hxx b/sw/source/uibase/inc/regionsw.hxx
index 52719c4..f4597d9 100644
--- a/sw/source/uibase/inc/regionsw.hxx
+++ b/sw/source/uibase/inc/regionsw.hxx
@@ -165,7 +165,7 @@ public:
    virtual bool        FillItemSet( SfxItemSet* ) override;
    virtual void        Reset( const SfxItemSet* ) override;

    static VclPtr<SfxTabPage>  Create( TabPageParent pParent,
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent,
                                const SfxItemSet* rAttrSet);
};

@@ -202,7 +202,7 @@ public:
    virtual bool        FillItemSet( SfxItemSet* ) override;
    virtual void        Reset( const SfxItemSet* ) override;

    static VclPtr<SfxTabPage>  Create( TabPageParent pParent,
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent,
                                const SfxItemSet* rAttrSet);
};

@@ -221,7 +221,7 @@ public:
    virtual bool        FillItemSet( SfxItemSet* ) override;
    virtual void        Reset( const SfxItemSet* ) override;

    static VclPtr<SfxTabPage>  Create(TabPageParent pParent, const SfxItemSet* rAttrSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet);

    void    SetWrtShell(SwWrtShell const & rSh);
};
diff --git a/sw/source/uibase/inc/swuiccoll.hxx b/sw/source/uibase/inc/swuiccoll.hxx
index c3f1002..a00b7c3 100644
--- a/sw/source/uibase/inc/swuiccoll.hxx
+++ b/sw/source/uibase/inc/swuiccoll.hxx
@@ -43,8 +43,6 @@ class SwCondCollPage : public SfxTabPage
    std::unique_ptr<weld::Button> m_xRemovePB;
    std::unique_ptr<weld::Button> m_xAssignPB;

    virtual ~SwCondCollPage() override;

    virtual DeactivateRC   DeactivatePage(SfxItemSet *pSet) override;

    DECL_LINK(OnOffHdl, weld::ToggleButton&, void);
@@ -55,15 +53,13 @@ class SwCondCollPage : public SfxTabPage
    void AssignRemove(const weld::Widget*);
    void SelectHdl(const weld::Widget*);

    using SfxTabPage::ActivatePage;
    using SfxTabPage::DeactivatePage;

    static const sal_uInt16 m_aPageRg[];

public:
    SwCondCollPage(TabPageParent pParent, const SfxItemSet &rSet);
    virtual ~SwCondCollPage() override;

    static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet);
    static const sal_uInt16* GetRanges() { return m_aPageRg; }

    virtual bool FillItemSet(      SfxItemSet *rSet) override;
diff --git a/sw/source/uibase/inc/swuicnttab.hxx b/sw/source/uibase/inc/swuicnttab.hxx
index b361302..a0e3da2 100644
--- a/sw/source/uibase/inc/swuicnttab.hxx
+++ b/sw/source/uibase/inc/swuicnttab.hxx
@@ -203,13 +203,9 @@ class SwTOXSelectTabPage : public SfxTabPage
    void ApplyTOXDescription();
    void FillTOXDescription();

    using SfxTabPage::ActivatePage;
    using SfxTabPage::DeactivatePage;

public:
    SwTOXSelectTabPage(TabPageParent pParent, const SfxItemSet& rAttrSet);
    virtual ~SwTOXSelectTabPage() override;
    virtual void        dispose() override;

    virtual bool        FillItemSet( SfxItemSet* ) override;
    virtual void        Reset( const SfxItemSet* ) override;
@@ -217,7 +213,7 @@ public:
    virtual void        ActivatePage( const SfxItemSet& ) override;
    virtual DeactivateRC   DeactivatePage( SfxItemSet* pSet ) override;

    static VclPtr<SfxTabPage>  Create( TabPageParent pParent,
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent,
                                const SfxItemSet* rAttrSet);

    void                SelectType(TOXTypes eSet);  //preset TOXType, GlobalDoc
@@ -242,7 +238,7 @@ class SwTokenWindow

    Idle            m_aAdjustPositionsIdle;

    VclPtr<SwTOXEntryTabPage>  m_pParent;
    SwTOXEntryTabPage*  m_pParent;
    std::unique_ptr<weld::Container> m_xParentWidget;
    std::unique_ptr<weld::Builder> m_xBuilder;
    std::unique_ptr<weld::Container> m_xContainer;
@@ -385,20 +381,16 @@ class SwTOXEntryTabPage : public SfxTabPage
    void OnModify(bool bAllLevels);
    DECL_LINK(ModifyClickHdl, weld::ToggleButton&, void);

    using SfxTabPage::ActivatePage;
    using SfxTabPage::DeactivatePage;

public:
    SwTOXEntryTabPage(TabPageParent pParent, const SfxItemSet& rAttrSet);
    virtual ~SwTOXEntryTabPage() override;
    virtual void dispose() override;

    virtual bool        FillItemSet( SfxItemSet* ) override;
    virtual void        Reset( const SfxItemSet* ) override;
    virtual void        ActivatePage( const SfxItemSet& ) override;
    virtual DeactivateRC   DeactivatePage( SfxItemSet* pSet ) override;

    static VclPtr<SfxTabPage>  Create( TabPageParent pParent,
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent,
                                       const SfxItemSet* rAttrSet);
    void                SetWrtShell(SwWrtShell& rSh);

@@ -429,9 +421,6 @@ class SwTOXStylesTabPage : public SfxTabPage
        return *pDlg->GetForm(pDlg->GetCurrentTOXType());
    }

    using SfxTabPage::ActivatePage;
    using SfxTabPage::DeactivatePage;

public:
    SwTOXStylesTabPage(TabPageParent pParent, const SfxItemSet& rAttrSet);
    virtual ~SwTOXStylesTabPage() override;
@@ -442,7 +431,7 @@ public:
    virtual void        ActivatePage( const SfxItemSet& ) override;
    virtual DeactivateRC   DeactivatePage( SfxItemSet* pSet ) override;

    static VclPtr<SfxTabPage>  Create( TabPageParent pParent,
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent,
                                       const SfxItemSet* rAttrSet);

};
diff --git a/sw/source/uibase/inc/wrap.hxx b/sw/source/uibase/inc/wrap.hxx
index bffc69b..4abeca2 100644
--- a/sw/source/uibase/inc/wrap.hxx
+++ b/sw/source/uibase/inc/wrap.hxx
@@ -68,8 +68,6 @@ class SwWrapTabPage: public SfxTabPage
    std::unique_ptr<weld::CheckButton> m_xWrapOutsideCB;
    std::unique_ptr<weld::CheckButton> m_xAllowOverlapCB;

    virtual ~SwWrapTabPage() override;

    void            SetImages();
    virtual void    ActivatePage(const SfxItemSet& rSet) override;
    virtual DeactivateRC   DeactivatePage(SfxItemSet *pSet) override;
@@ -78,15 +76,12 @@ class SwWrapTabPage: public SfxTabPage
    DECL_LINK(WrapTypeHdl, weld::ToggleButton&, void);
    DECL_LINK(ContourHdl, weld::ToggleButton&, void);

    using SfxTabPage::ActivatePage;
    using SfxTabPage::DeactivatePage;

    static const sal_uInt16 m_aWrapPageRg[];

public:
    SwWrapTabPage(TabPageParent pParent, const SfxItemSet &rSet);

    static VclPtr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet);
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet *rSet);
    virtual ~SwWrapTabPage() override;

    virtual bool    FillItemSet(SfxItemSet *rSet) override;
    virtual void    Reset(const SfxItemSet *rSet) override;
diff --git a/sw/source/uibase/table/tablepg.hxx b/sw/source/uibase/table/tablepg.hxx
index f9d7c8d..6aea655 100644
--- a/sw/source/uibase/table/tablepg.hxx
+++ b/sw/source/uibase/table/tablepg.hxx
@@ -73,14 +73,11 @@ class SwFormatTablePage : public SfxTabPage
    void RightModify();
    DECL_LINK(ValueChangedHdl, weld::MetricSpinButton&, void);

    using TabPage::ActivatePage;
    using TabPage::DeactivatePage;

public:
    SwFormatTablePage(TabPageParent pParent, const SfxItemSet& rSet );
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet);
    virtual ~SwFormatTablePage() override;

    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& rSet ) override;
@@ -124,15 +121,11 @@ class SwTableColumnPage : public SfxTabPage
    void        SetVisibleWidth(sal_uInt16 nPos, SwTwips nNewWidth);
    DECL_LINK(SizeHdl, void*, void);

    using TabPage::ActivatePage;
    using TabPage::DeactivatePage;

public:
    SwTableColumnPage(TabPageParent pParent, const SfxItemSet& rSet);
    virtual void dispose() override;
    static std::unique_ptr<SfxTabPage> Create(TabPageParent pParent, const SfxItemSet* rAttrSet);
    virtual ~SwTableColumnPage() override;

    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& rSet ) override;
@@ -174,8 +167,8 @@ class SwTextFlowPage : public SfxTabPage

public:
    SwTextFlowPage(TabPageParent pParent, const SfxItemSet& rSet);
    static std::unique_ptr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet);
    virtual ~SwTextFlowPage() override;
    static VclPtr<SfxTabPage>  Create( TabPageParent pParent, const SfxItemSet* rAttrSet);
    virtual bool        FillItemSet( SfxItemSet* rSet ) override;
    virtual void        Reset( const SfxItemSet* rSet ) override;

diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx
index 04f1344..7306f75 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -1696,7 +1696,7 @@ bool SwPagePreview::HasPrintOptionsPage() const
    return true;
}

VclPtr<SfxTabPage> SwPagePreview::CreatePrintOptionsPage(TabPageParent pParent,
std::unique_ptr<SfxTabPage> SwPagePreview::CreatePrintOptionsPage(TabPageParent pParent,
                                                         const SfxItemSet &rOptions)
{
    return ::CreatePrintOptionsPage(pParent, rOptions, !m_bNormalPrint);
diff --git a/sw/source/uibase/uiview/viewprt.cxx b/sw/source/uibase/uiview/viewprt.cxx
index 1aaa7750..52f82f0 100644
--- a/sw/source/uibase/uiview/viewprt.cxx
+++ b/sw/source/uibase/uiview/viewprt.cxx
@@ -174,7 +174,7 @@ namespace

// TabPage for application-specific print options

VclPtr<SfxTabPage> SwView::CreatePrintOptionsPage(TabPageParent pParent,
std::unique_ptr<SfxTabPage> SwView::CreatePrintOptionsPage(TabPageParent pParent,
                                                  const SfxItemSet& rSet)
{
    return ::CreatePrintOptionsPage(pParent, rSet, false);
@@ -307,7 +307,7 @@ void SwView::NotifyCursor(SfxViewShell* pViewShell) const

// Create page printer/additions for SwView and SwPagePreview

VclPtr<SfxTabPage> CreatePrintOptionsPage(TabPageParent pParent,
std::unique_ptr<SfxTabPage> CreatePrintOptionsPage(TabPageParent pParent,
                                          const SfxItemSet &rOptions,
                                          bool bPreview)
{
@@ -318,16 +318,16 @@ VclPtr<SfxTabPage> CreatePrintOptionsPage(TabPageParent pParent,
    if (!fnCreatePage)
        return nullptr;

    VclPtr<SfxTabPage> pSfxPage = fnCreatePage(pParent, &rOptions);
    OSL_ENSURE(pSfxPage, "No page");
    if (!pSfxPage)
    std::unique_ptr<SfxTabPage> xSfxPage = fnCreatePage(pParent, &rOptions);
    OSL_ENSURE(xSfxPage, "No page");
    if (!xSfxPage)
        return nullptr;

    SfxAllItemSet aSet(*(rOptions.GetPool()));
    aSet.Put(SfxBoolItem(SID_PREVIEWFLAG_TYPE, bPreview));
    aSet.Put(SfxBoolItem(SID_FAX_LIST, true));
    pSfxPage->PageCreated(aSet);
    return pSfxPage;
    xSfxPage->PageCreated(aSet);
    return xSfxPage;
}

void SetAppPrintOptions( SwViewShell* pSh, bool bWeb )
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 20227b6..c0cd48b 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -395,6 +395,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
    vcl/source/app/unohelp2 \
    vcl/source/app/unohelp \
    vcl/source/app/vclevent \
    vcl/source/app/weldutils \
    vcl/source/app/winscheduler \
    vcl/source/components/dtranscomp \
    vcl/source/components/factory \
diff --git a/vcl/inc/wizdlg.hxx b/vcl/inc/wizdlg.hxx
index 68cccb5..d07ca12 100644
--- a/vcl/inc/wizdlg.hxx
+++ b/vcl/inc/wizdlg.hxx
@@ -21,8 +21,16 @@
#define INCLUDED_VCL_WIZDLG_HXX

#include <memory>
#include <vcl/button.hxx>
#include <vcl/dialog.hxx>
#include <vcl/roadmapwizard.hxx>

struct ImplWizPageData
{
    ImplWizPageData*    mpNext;
    VclPtr<TabPage>     mpPage;
};

namespace vcl
{
    struct RoadmapWizardImpl;
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 2063a4e..fdebbc4 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -5973,86 +5973,4 @@ weld::Window* SalFrame::GetFrameWeld() const
    return m_xFrameWeld.get();
}

namespace weld
{
    bool DialogController::runAsync(const std::shared_ptr<DialogController>& rController, const std::function<void(sal_Int32)>& func)
    {
        return rController->getDialog()->runAsync(rController, func);
    }

    DialogController::~DialogController() COVERITY_NOEXCEPT_FALSE
    {
    }

    Dialog* GenericDialogController::getDialog() { return m_xDialog.get(); }

    GenericDialogController::GenericDialogController(weld::Widget* pParent, const OUString &rUIFile, const OString& rDialogId)
        : m_xBuilder(Application::CreateBuilder(pParent, rUIFile))
        , m_xDialog(m_xBuilder->weld_dialog(rDialogId))
    {
    }

    GenericDialogController::~GenericDialogController() COVERITY_NOEXCEPT_FALSE
    {
    }

    Dialog* MessageDialogController::getDialog() { return m_xDialog.get(); }

    MessageDialogController::MessageDialogController(weld::Widget* pParent, const OUString &rUIFile, const OString& rDialogId,
            const OString& rRelocateId)
        : m_xBuilder(Application::CreateBuilder(pParent, rUIFile))
        , m_xDialog(m_xBuilder->weld_message_dialog(rDialogId))
        , m_xContentArea(m_xDialog->weld_message_area())
    {
        if (!rRelocateId.isEmpty())
        {
            m_xRelocate = m_xBuilder->weld_container(rRelocateId);
            m_xOrigParent = m_xRelocate->weld_parent();
            //fdo#75121, a bit tricky because the widgets we want to align with
            //don't actually exist in the ui description, they're implied
            m_xOrigParent->move(m_xRelocate.get(), m_xContentArea.get());
        }
    }

    MessageDialogController::~MessageDialogController()
    {
        if (m_xRelocate)
        {
            m_xContentArea->move(m_xRelocate.get(), m_xOrigParent.get());
        }
    }

    AssistantController::AssistantController(weld::Widget* pParent, const OUString &rUIFile, const OString& rDialogId)
        : m_xBuilder(Application::CreateBuilder(pParent, rUIFile))
        , m_xAssistant(m_xBuilder->weld_assistant(rDialogId))
    {
    }

    Dialog* AssistantController::getDialog() { return m_xAssistant.get(); }

    AssistantController::~AssistantController()
    {
    }

    void TriStateEnabled::ButtonToggled(weld::ToggleButton& rToggle)
    {
        if (bTriStateEnabled)
        {
            switch (eState)
            {
                case TRISTATE_INDET:
                    rToggle.set_state(TRISTATE_FALSE);
                    break;
                case TRISTATE_TRUE:
                    rToggle.set_state(TRISTATE_INDET);
                    break;
                case TRISTATE_FALSE:
                    rToggle.set_state(TRISTATE_TRUE);
                    break;
            }
        }
        eState = rToggle.get_state();
    }
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/weldutils.cxx b/vcl/source/app/weldutils.cxx
new file mode 100644
index 0000000..11fc208
--- /dev/null
+++ b/vcl/source/app/weldutils.cxx
@@ -0,0 +1,107 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#include <vcl/builderpage.hxx>
#include <vcl/svapp.hxx>

BuilderPage::BuilderPage(weld::Widget* pParent, weld::DialogController* pController,
                         const OUString& rUIXMLDescription, const OString& rID)
    : m_pDialogController(pController)
    , m_xBuilder(Application::CreateBuilder(pParent, rUIXMLDescription))
    , m_xContainer(m_xBuilder->weld_container(rID))
{
}

void BuilderPage::Activate() {}

void BuilderPage::Deactivate() {}

BuilderPage::~BuilderPage() {}

namespace weld
{
bool DialogController::runAsync(const std::shared_ptr<DialogController>& rController,
                                const std::function<void(sal_Int32)>& func)
{
    return rController->getDialog()->runAsync(rController, func);
}

DialogController::~DialogController() COVERITY_NOEXCEPT_FALSE {}

Dialog* GenericDialogController::getDialog() { return m_xDialog.get(); }

GenericDialogController::GenericDialogController(weld::Widget* pParent, const OUString& rUIFile,
                                                 const OString& rDialogId)
    : m_xBuilder(Application::CreateBuilder(pParent, rUIFile))
    , m_xDialog(m_xBuilder->weld_dialog(rDialogId))
{
}

GenericDialogController::~GenericDialogController() COVERITY_NOEXCEPT_FALSE {}

Dialog* MessageDialogController::getDialog() { return m_xDialog.get(); }

MessageDialogController::MessageDialogController(weld::Widget* pParent, const OUString& rUIFile,
                                                 const OString& rDialogId,
                                                 const OString& rRelocateId)
    : m_xBuilder(Application::CreateBuilder(pParent, rUIFile))
    , m_xDialog(m_xBuilder->weld_message_dialog(rDialogId))
    , m_xContentArea(m_xDialog->weld_message_area())
{
    if (!rRelocateId.isEmpty())
    {
        m_xRelocate = m_xBuilder->weld_container(rRelocateId);
        m_xOrigParent = m_xRelocate->weld_parent();
        //fdo#75121, a bit tricky because the widgets we want to align with
        //don't actually exist in the ui description, they're implied
        m_xOrigParent->move(m_xRelocate.get(), m_xContentArea.get());
    }
}

MessageDialogController::~MessageDialogController()
{
    if (m_xRelocate)
    {
        m_xContentArea->move(m_xRelocate.get(), m_xOrigParent.get());
    }
}

AssistantController::AssistantController(weld::Widget* pParent, const OUString& rUIFile,
                                         const OString& rDialogId)
    : m_xBuilder(Application::CreateBuilder(pParent, rUIFile))
    , m_xAssistant(m_xBuilder->weld_assistant(rDialogId))
{
}

Dialog* AssistantController::getDialog() { return m_xAssistant.get(); }

AssistantController::~AssistantController() {}

void TriStateEnabled::ButtonToggled(weld::ToggleButton& rToggle)
{
    if (bTriStateEnabled)
    {
        switch (eState)
        {
            case TRISTATE_INDET:
                rToggle.set_state(TRISTATE_FALSE);
                break;
            case TRISTATE_TRUE:
                rToggle.set_state(TRISTATE_INDET);
                break;
            case TRISTATE_FALSE:
                rToggle.set_state(TRISTATE_TRUE);
                break;
        }
    }
    eState = rToggle.get_state();
}
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/roadmapwizard.cxx b/vcl/source/control/roadmapwizard.cxx
index 4ef52d6..a046db7 100644
--- a/vcl/source/control/roadmapwizard.cxx
+++ b/vcl/source/control/roadmapwizard.cxx
@@ -478,7 +478,7 @@ namespace vcl

        // can we advance from the current page?
        bool bCurrentPageCanAdvance = true;
        TabPage* pCurrentPage = GetPage( getCurrentState() );
        BuilderPage* pCurrentPage = GetPage( getCurrentState() );
        if ( pCurrentPage )
        {
            const IWizardPageController* pController = getPageController( GetPage( getCurrentState() ) );
diff --git a/vcl/source/control/wizardmachine.cxx b/vcl/source/control/wizardmachine.cxx
index fc394da..41cb6b6d 100644
--- a/vcl/source/control/wizardmachine.cxx
+++ b/vcl/source/control/wizardmachine.cxx
@@ -39,38 +39,28 @@ namespace vcl
{
    //= WizardPageImplData
    OWizardPage::OWizardPage(TabPageParent pParent, const OUString& rUIXMLDescription, const OString& rID)
        : TabPage(pParent.pPage ? Application::GetDefDialogParent() : pParent.pParent.get()) //just drag this along hidden in this scenario
        , m_xBuilder(pParent.pPage ? Application::CreateBuilder(pParent.pPage, rUIXMLDescription)
                                   : Application::CreateInterimBuilder(this, rUIXMLDescription))
        , m_xContainer(m_xBuilder->weld_container(rID))
        : BuilderPage(pParent.pPage, pParent.pController, rUIXMLDescription, rID)
    {
    }

    OWizardPage::~OWizardPage()
    {
        disposeOnce();
    }

    void OWizardPage::dispose()
    {
        m_xBuilder.reset();
        TabPage::dispose();
    }

    void OWizardPage::initializePage()
    {
    }

    void OWizardPage::ActivatePage()
    void OWizardPage::Activate()
    {
        TabPage::ActivatePage();
        BuilderPage::Activate();
        updateDialogTravelUI();
    }

    void OWizardPage::updateDialogTravelUI()
    {
        RoadmapWizard* pWizardMachine = dynamic_cast<RoadmapWizard*>(GetParent());
        if ( pWizardMachine )
        auto pWizardMachine = dynamic_cast<RoadmapWizardMachine*>(m_pDialogController);
        if (pWizardMachine)
            pWizardMachine->updateTravelUI();
    }

@@ -1064,6 +1054,7 @@ namespace vcl

    WizardMachine::WizardMachine(weld::Window* pParent, WizardButtonFlags nButtonFlags)
        : AssistantController(pParent, "vcl/ui/wizard.ui", "Wizard")
        , m_pCurTabPage(nullptr)
        , m_nCurState(0)
        , m_pFirstPage(nullptr)
        , m_xFinish(m_xAssistant->weld_widget_for_response(RET_OK))
@@ -1134,13 +1125,7 @@ namespace vcl
        if (m_pImpl)
        {
            while (m_pFirstPage)
            {
                VclPtr<TabPage> pPage = m_pFirstPage->mpPage;
                RemovePage(m_pFirstPage->mpPage);
                if (pPage)
                    pPage.disposeAndClear();
            }

                RemovePage(m_pFirstPage->mxPage.get());
            m_pImpl.reset();
        }
    }
@@ -1150,10 +1135,10 @@ namespace vcl
        OUString sCompleteTitle(m_pImpl->sTitleBase);

        // append the page title
        TabPage* pCurrentPage = GetPage(getCurrentState());
        if ( pCurrentPage && !pCurrentPage->GetText().isEmpty() )
        BuilderPage* pCurrentPage = GetPage(getCurrentState());
        if ( pCurrentPage && !pCurrentPage->GetPageTitle().isEmpty() )
        {
            sCompleteTitle += " - " + pCurrentPage->GetText();
            sCompleteTitle += " - " + pCurrentPage->GetPageTitle();
        }

        m_xAssistant->set_title(sCompleteTitle);
@@ -1165,12 +1150,12 @@ namespace vcl
        implUpdateTitle();
    }

    TabPage* WizardMachine::GetOrCreatePage( const WizardTypes::WizardState i_nState )
    BuilderPage* WizardMachine::GetOrCreatePage( const WizardTypes::WizardState i_nState )
    {
        if ( nullptr == GetPage( i_nState ) )
        {
            VclPtr<TabPage> pNewPage = createPage( i_nState );
            DBG_ASSERT( pNewPage, "WizardMachine::GetOrCreatePage: invalid new page (NULL)!" );
            std::unique_ptr<BuilderPage> xNewPage = createPage( i_nState );
            DBG_ASSERT( xNewPage, "WizardMachine::GetOrCreatePage: invalid new page (NULL)!" );

            // fill up the page sequence of our base class (with dummies)
            while ( m_pImpl->nFirstUnknownPage < i_nState )
@@ -1182,12 +1167,12 @@ namespace vcl
            if ( m_pImpl->nFirstUnknownPage == i_nState )
            {
                // encountered this page number the first time
                AddPage( pNewPage );
                AddPage(std::move(xNewPage));
                ++m_pImpl->nFirstUnknownPage;
            }
            else
                // already had this page - just change it
                SetPage( i_nState, pNewPage );
                SetPage(i_nState, std::move(xNewPage));
        }
        return GetPage( i_nState );
    }
@@ -1438,18 +1423,18 @@ namespace vcl
    {
        if (DeactivatePage())
        {
            TabPage* pOldTabPage = m_xCurTabPage;
            BuilderPage* pOldTabPage = m_pCurTabPage;

            m_nCurState = nState;
            ActivatePage();

            if (pOldTabPage)
                pOldTabPage->DeactivatePage();
                pOldTabPage->Deactivate();

            m_xAssistant->set_current_page(OString::number(nState));

            m_xCurTabPage = GetPage(m_nCurState);
            m_xCurTabPage->ActivatePage();
            m_pCurTabPage = GetPage(m_nCurState);
            m_pCurTabPage->Activate();

            return true;
        }
@@ -1541,9 +1526,9 @@ namespace vcl
        travelNext();
    }

    IWizardPageController* WizardMachine::getPageController( TabPage* _pCurrentPage ) const
    IWizardPageController* WizardMachine::getPageController(BuilderPage* pCurrentPage) const
    {
        IWizardPageController* pController = dynamic_cast< IWizardPageController* >( _pCurrentPage );
        IWizardPageController* pController = dynamic_cast<IWizardPageController*>(pCurrentPage);
        return pController;
    }

@@ -1594,8 +1579,8 @@ namespace vcl
    {
        if ( DeactivatePage() )
        {
            if (m_xCurTabPage)
                m_xCurTabPage->DeactivatePage();
            if (m_pCurTabPage)
                m_pCurTabPage->Deactivate();

            m_xAssistant->response(nResult);
            return true;
@@ -1604,37 +1589,37 @@ namespace vcl
            return false;
    }

    void WizardMachine::AddPage( TabPage* pPage )
    void WizardMachine::AddPage(std::unique_ptr<BuilderPage> xPage)
    {
        ImplWizPageData* pNewPageData = new ImplWizPageData;
        pNewPageData->mpNext    = nullptr;
        pNewPageData->mpPage    = pPage;
        WizPageData* pNewPageData = new WizPageData;
        pNewPageData->mpNext = nullptr;
        pNewPageData->mxPage = std::move(xPage);

        if ( !m_pFirstPage )
            m_pFirstPage = pNewPageData;
        else
        {
            ImplWizPageData* pPageData = m_pFirstPage;
            WizPageData* pPageData = m_pFirstPage;
            while ( pPageData->mpNext )
                pPageData = pPageData->mpNext;
            pPageData->mpNext = pNewPageData;
        }
    }

    void WizardMachine::RemovePage( TabPage* pPage )
    void WizardMachine::RemovePage(BuilderPage* pPage)
    {
        ImplWizPageData*  pPrevPageData = nullptr;
        ImplWizPageData*  pPageData = m_pFirstPage;
        WizPageData* pPrevPageData = nullptr;
        WizPageData* pPageData = m_pFirstPage;
        while ( pPageData )
        {
            if ( pPageData->mpPage == pPage )
            if (pPageData->mxPage.get() == pPage)
            {
                if (pPrevPageData)
                    pPrevPageData->mpNext = pPageData->mpNext;
                else
                    m_pFirstPage = pPageData->mpNext;
                if (pPage == m_xCurTabPage)
                    m_xCurTabPage.clear();
                if (pPage == m_pCurTabPage)
                    m_pCurTabPage = nullptr;
                delete pPageData;
                return;
            }
@@ -1646,10 +1631,10 @@ namespace vcl
        OSL_FAIL( "WizardMachine::RemovePage() - Page not in list" );
    }

    void WizardMachine::SetPage(WizardTypes::WizardState nLevel, TabPage* pPage)
    void WizardMachine::SetPage(WizardTypes::WizardState nLevel, std::unique_ptr<BuilderPage> xPage)
    {
        sal_uInt16              nTempLevel = 0;
        ImplWizPageData*    pPageData = m_pFirstPage;
        WizPageData*    pPageData = m_pFirstPage;
        while ( pPageData )
        {
            if ( (nTempLevel == nLevel) || !pPageData->mpNext )
@@ -1661,21 +1646,21 @@ namespace vcl

        if ( pPageData )
        {
            if ( pPageData->mpPage == m_xCurTabPage )
                m_xCurTabPage = nullptr;
            pPageData->mpPage = pPage;
            if (pPageData->mxPage.get() == m_pCurTabPage)
                m_pCurTabPage = nullptr;
            pPageData->mxPage = std::move(xPage);
        }
    }

    TabPage* WizardMachine::GetPage(WizardTypes::WizardState nLevel) const
    BuilderPage* WizardMachine::GetPage(WizardTypes::WizardState nLevel) const
    {
        sal_uInt16 nTempLevel = 0;

        for (ImplWizPageData* pPageData = m_pFirstPage; pPageData;
        for (WizPageData* pPageData = m_pFirstPage; pPageData;
             pPageData = pPageData->mpNext)
        {
            if ( nTempLevel == nLevel )
                return pPageData->mpPage;
                return pPageData->mxPage.get();
            nTempLevel++;
        }

diff --git a/vcl/source/control/wizimpldata.hxx b/vcl/source/control/wizimpldata.hxx
index d6180516..fdac4ba 100644
--- a/vcl/source/control/wizimpldata.hxx
+++ b/vcl/source/control/wizimpldata.hxx
@@ -22,10 +22,10 @@

#include <stack>

struct ImplWizPageData
struct WizPageData
{
    ImplWizPageData*    mpNext;
    VclPtr<TabPage>     mpPage;
    WizPageData*    mpNext;
    std::unique_ptr<BuilderPage> mxPage;
};

struct ImplWizButtonData