diff options
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/attrdlg/scdlgfact.cxx | 26 | ||||
-rw-r--r-- | sc/source/ui/attrdlg/scdlgfact.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/inc/hfedtdlg.hxx | 28 | ||||
-rw-r--r-- | sc/source/ui/pagedlg/hfedtdlg.cxx | 105 | ||||
-rw-r--r-- | sc/source/ui/pagedlg/tphf.cxx | 2 |
6 files changed, 84 insertions, 82 deletions
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index 740c06ffc2a2..f2074b170845 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -989,51 +989,51 @@ VclPtr<SfxAbstractTabDialog> ScAbstractDialogFactory_Impl::CreateScAttrDlg(weld: return VclPtr<ScAbstractTabController_Impl>::Create(std::make_unique<ScAttrDlg>(pParent, pCellAttrs)); } -VclPtr<SfxAbstractTabDialog> ScAbstractDialogFactory_Impl::CreateScHFEditDlg( vcl::Window* pParent, +VclPtr<SfxAbstractTabDialog> ScAbstractDialogFactory_Impl::CreateScHFEditDlg( weld::Window* pParent, const SfxItemSet& rCoreSet, const OUString& rPageStyle, sal_uInt16 nResId ) { - VclPtr<SfxTabDialog> pDlg; + std::unique_ptr<SfxTabDialogController> xDlg; switch (nResId) { case RID_SCDLG_HFED_HEADER: case RID_SCDLG_HFEDIT_HEADER: - pDlg = VclPtr<ScHFEditHeaderDlg>::Create(pParent, rCoreSet, rPageStyle); + xDlg = std::make_unique<ScHFEditHeaderDlg>(pParent, rCoreSet, rPageStyle); break; case RID_SCDLG_HFED_FOOTER: case RID_SCDLG_HFEDIT_FOOTER: - pDlg = VclPtr<ScHFEditFooterDlg>::Create(pParent, rCoreSet, rPageStyle); + xDlg = std::make_unique<ScHFEditFooterDlg>(pParent, rCoreSet, rPageStyle); break; case RID_SCDLG_HFEDIT_LEFTHEADER: - pDlg = VclPtr<ScHFEditLeftHeaderDlg>::Create(pParent, rCoreSet, rPageStyle); + xDlg = std::make_unique<ScHFEditLeftHeaderDlg>(pParent, rCoreSet, rPageStyle); break; case RID_SCDLG_HFEDIT_RIGHTHEADER: - pDlg = VclPtr<ScHFEditRightHeaderDlg>::Create(pParent, rCoreSet, rPageStyle); + xDlg = std::make_unique<ScHFEditRightHeaderDlg>(pParent, rCoreSet, rPageStyle); break; case RID_SCDLG_HFEDIT_LEFTFOOTER: - pDlg = VclPtr<ScHFEditLeftFooterDlg>::Create(pParent, rCoreSet, rPageStyle); + xDlg = std::make_unique<ScHFEditLeftFooterDlg>(pParent, rCoreSet, rPageStyle); break; case RID_SCDLG_HFEDIT_RIGHTFOOTER: - pDlg = VclPtr<ScHFEditRightFooterDlg>::Create(pParent, rCoreSet, rPageStyle); + xDlg = std::make_unique<ScHFEditRightFooterDlg>(pParent, rCoreSet, rPageStyle); break; case RID_SCDLG_HFEDIT_SHDR: - pDlg = VclPtr<ScHFEditSharedHeaderDlg>::Create(pParent, rCoreSet, rPageStyle); + xDlg = std::make_unique<ScHFEditSharedHeaderDlg>(pParent, rCoreSet, rPageStyle); break; case RID_SCDLG_HFEDIT_SFTR: - pDlg = VclPtr<ScHFEditSharedFooterDlg>::Create(pParent, rCoreSet, rPageStyle); + xDlg = std::make_unique<ScHFEditSharedFooterDlg>(pParent, rCoreSet, rPageStyle); break; case RID_SCDLG_HFEDIT_ALL: - pDlg = VclPtr<ScHFEditAllDlg>::Create(pParent, rCoreSet, rPageStyle); + xDlg = std::make_unique<ScHFEditAllDlg>(pParent, rCoreSet, rPageStyle); break; default: case RID_SCDLG_HFEDIT: - pDlg = VclPtr<ScHFEditActiveDlg>::Create(pParent, rCoreSet, rPageStyle); + xDlg = std::make_unique<ScHFEditActiveDlg>(pParent, rCoreSet, rPageStyle); break; } - return pDlg ? VclPtr<ScAbstractTabDialog_Impl>::Create( pDlg ) : nullptr; + return xDlg ? VclPtr<ScAbstractTabController_Impl>::Create(std::move(xDlg)) : nullptr; } VclPtr<SfxAbstractTabDialog> ScAbstractDialogFactory_Impl::CreateScStyleDlg(weld::Window* pParent, diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index aa8c949c337f..85e5927bb77e 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -717,7 +717,7 @@ public: virtual VclPtr<SfxAbstractTabDialog> CreateScAttrDlg(weld::Window* pParent, const SfxItemSet* pCellAttrs) override; - virtual VclPtr<SfxAbstractTabDialog> CreateScHFEditDlg(vcl::Window* pParent, + virtual VclPtr<SfxAbstractTabDialog> CreateScHFEditDlg(weld::Window* pParent, const SfxItemSet& rCoreSet, const OUString& rPageStyle, sal_uInt16 nResId ) override; diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index ddb1053ef21c..de8d9e0d118e 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -1844,8 +1844,9 @@ void ScDocShell::ExecutePageStyle( const SfxViewShell& rCaller, ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); + vcl::Window *pDialogParent = GetActiveDialogParent(); VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg( - GetActiveDialogParent(), + pDialogParent ? pDialogParent->GetFrameWeld() : nullptr, rStyleSet, aStr, nResId)); diff --git a/sc/source/ui/inc/hfedtdlg.hxx b/sc/source/ui/inc/hfedtdlg.hxx index 0011bd2fcc4d..d1448e8fa836 100644 --- a/sc/source/ui/inc/hfedtdlg.hxx +++ b/sc/source/ui/inc/hfedtdlg.hxx @@ -23,84 +23,84 @@ #include <sfx2/tabdlg.hxx> #include <editeng/svxenum.hxx> -class ScHFEditDlg : public SfxTabDialog +class ScHFEditDlg : public SfxTabDialogController { SvxNumType eNumType; protected: - ScHFEditDlg(vcl::Window* pParent, + ScHFEditDlg(weld::Window* pParent, const SfxItemSet& rCoreSet, const OUString& rPageStyle, - const OUString& rID, const OUString& rUIXMLDescription ); + const OUString& rUIXMLDescription, const OString& rID); public: - virtual void PageCreated( sal_uInt16 nId, SfxTabPage& rPage ) override; + virtual void PageCreated(const OString& rId, SfxTabPage& rPage) override; }; class ScHFEditHeaderDlg : public ScHFEditDlg { public: - ScHFEditHeaderDlg(vcl::Window* pParent, + ScHFEditHeaderDlg(weld::Window* pParent, const SfxItemSet& rCoreSet, const OUString& rPageStyle); }; class ScHFEditFooterDlg : public ScHFEditDlg { public: - ScHFEditFooterDlg(vcl::Window* pParent, + ScHFEditFooterDlg(weld::Window* pParent, const SfxItemSet& rCoreSet, const OUString& rPageStyle); }; class ScHFEditLeftHeaderDlg : public ScHFEditDlg { public: - ScHFEditLeftHeaderDlg(vcl::Window* pParent, + ScHFEditLeftHeaderDlg(weld::Window* pParent, const SfxItemSet& rCoreSet, const OUString& rPageStyle); }; class ScHFEditRightHeaderDlg : public ScHFEditDlg { public: - ScHFEditRightHeaderDlg(vcl::Window* pParent, + ScHFEditRightHeaderDlg(weld::Window* pParent, const SfxItemSet& rCoreSet, const OUString& rPageStyle); }; class ScHFEditLeftFooterDlg : public ScHFEditDlg { public: - ScHFEditLeftFooterDlg(vcl::Window* pParent, + ScHFEditLeftFooterDlg(weld::Window* pParent, const SfxItemSet& rCoreSet, const OUString& rPageStyle); }; class ScHFEditRightFooterDlg : public ScHFEditDlg { public: - ScHFEditRightFooterDlg(vcl::Window* pParent, + ScHFEditRightFooterDlg(weld::Window* pParent, const SfxItemSet& rCoreSet, const OUString& rPageStyle); }; class ScHFEditSharedHeaderDlg : public ScHFEditDlg { public: - ScHFEditSharedHeaderDlg(vcl::Window* pParent, + ScHFEditSharedHeaderDlg(weld::Window* pParent, const SfxItemSet& rCoreSet, const OUString& rPageStyle); }; class ScHFEditSharedFooterDlg : public ScHFEditDlg { public: - ScHFEditSharedFooterDlg(vcl::Window* pParent, + ScHFEditSharedFooterDlg(weld::Window* pParent, const SfxItemSet& rCoreSet, const OUString& rPageStyle); }; class ScHFEditAllDlg : public ScHFEditDlg { public: - ScHFEditAllDlg(vcl::Window* pParent, + ScHFEditAllDlg(weld::Window* pParent, const SfxItemSet& rCoreSet, const OUString& rPageStyle); }; class ScHFEditActiveDlg : public ScHFEditDlg { public: - ScHFEditActiveDlg(vcl::Window* pParent, + ScHFEditActiveDlg(weld::Window* pParent, const SfxItemSet& rCoreSet, const OUString& rPageStyle); }; diff --git a/sc/source/ui/pagedlg/hfedtdlg.cxx b/sc/source/ui/pagedlg/hfedtdlg.cxx index 0eb5953f0689..9349cd8c50a1 100644 --- a/sc/source/ui/pagedlg/hfedtdlg.cxx +++ b/sc/source/ui/pagedlg/hfedtdlg.cxx @@ -29,126 +29,127 @@ #include <svx/svxids.hrc> #include <svx/pageitem.hxx> -ScHFEditDlg::ScHFEditDlg( vcl::Window* pParent, - const SfxItemSet& rCoreSet, - const OUString& rPageStyle, - const OUString& rID, const OUString& rUIXMLDescription ) - : SfxTabDialog( pParent, rID, rUIXMLDescription, &rCoreSet ) +ScHFEditDlg::ScHFEditDlg(weld::Window* pParent, + const SfxItemSet& rCoreSet, + const OUString& rPageStyle, + const OUString& rUIXMLDescription, + const OString& rID) + : SfxTabDialogController(pParent, rUIXMLDescription, rID, &rCoreSet) { eNumType = rCoreSet.Get(ATTR_PAGE).GetNumType(); - OUString aTmp = GetText(); + OUString aTmp = m_xDialog->get_title(); aTmp += " (" + ScResId( STR_PAGESTYLE ) + ": " + rPageStyle + ")"; - SetText( aTmp ); + m_xDialog->set_title(aTmp); } ScHFEditHeaderDlg::ScHFEditHeaderDlg( - vcl::Window* pParent, + weld::Window* pParent, const SfxItemSet& rCoreSet, const OUString& rPageStyle) : ScHFEditDlg( pParent, rCoreSet, rPageStyle, - "HeaderDialog", "modules/scalc/ui/headerdialog.ui" ) + "modules/scalc/ui/headerdialog.ui", "HeaderDialog") { - AddTabPage( "headerright", ScRightHeaderEditPage::Create ); - AddTabPage( "headerleft", ScLeftHeaderEditPage::Create ); + AddTabPage("headerright", ScRightHeaderEditPage::Create, nullptr); + AddTabPage("headerleft", ScLeftHeaderEditPage::Create, nullptr); } ScHFEditFooterDlg::ScHFEditFooterDlg( - vcl::Window* pParent, + weld::Window* pParent, const SfxItemSet& rCoreSet, const OUString& rPageStyle) : ScHFEditDlg( pParent, rCoreSet, rPageStyle, - "FooterDialog", "modules/scalc/ui/footerdialog.ui" ) + "modules/scalc/ui/footerdialog.ui", "FooterDialog" ) { - AddTabPage( "footerright", ScRightFooterEditPage::Create ); - AddTabPage( "footerleft", ScLeftFooterEditPage::Create ); + AddTabPage("footerright", ScRightFooterEditPage::Create, nullptr); + AddTabPage("footerleft", ScLeftFooterEditPage::Create, nullptr); } ScHFEditLeftHeaderDlg::ScHFEditLeftHeaderDlg( - vcl::Window* pParent, + weld::Window* pParent, const SfxItemSet& rCoreSet, const OUString& rPageStyle) : ScHFEditDlg( pParent, rCoreSet, rPageStyle, - "LeftHeaderDialog", "modules/scalc/ui/leftheaderdialog.ui" ) + "modules/scalc/ui/leftheaderdialog.ui", "LeftHeaderDialog" ) { - AddTabPage( "headerleft", ScLeftHeaderEditPage::Create ); + AddTabPage("headerleft", ScLeftHeaderEditPage::Create, nullptr); } ScHFEditRightHeaderDlg::ScHFEditRightHeaderDlg( - vcl::Window* pParent, + weld::Window* pParent, const SfxItemSet& rCoreSet, const OUString& rPageStyle) : ScHFEditDlg( pParent, rCoreSet, rPageStyle, - "RightHeaderDialog", "modules/scalc/ui/rightheaderdialog.ui" ) + "modules/scalc/ui/rightheaderdialog.ui", "RightHeaderDialog" ) { - AddTabPage( "headerright", ScRightHeaderEditPage::Create ); + AddTabPage("headerright", ScRightHeaderEditPage::Create, nullptr); } ScHFEditLeftFooterDlg::ScHFEditLeftFooterDlg( - vcl::Window* pParent, + weld::Window* pParent, const SfxItemSet& rCoreSet, const OUString& rPageStyle) : ScHFEditDlg( pParent, rCoreSet, rPageStyle, - "LeftFooterDialog", "modules/scalc/ui/leftfooterdialog.ui" ) + "modules/scalc/ui/leftfooterdialog.ui", "LeftFooterDialog" ) { - AddTabPage( "footerleft", ScLeftFooterEditPage::Create ); + AddTabPage("footerleft", ScLeftFooterEditPage::Create, nullptr); } ScHFEditRightFooterDlg::ScHFEditRightFooterDlg( - vcl::Window* pParent, + weld::Window* pParent, const SfxItemSet& rCoreSet, const OUString& rPageStyle) : ScHFEditDlg( pParent, rCoreSet, rPageStyle, - "RightFooterDialog", "modules/scalc/ui/rightfooterdialog.ui" ) + "modules/scalc/ui/rightfooterdialog.ui", "RightFooterDialog" ) { - AddTabPage( "footerright", ScRightFooterEditPage::Create ); + AddTabPage("footerright", ScRightFooterEditPage::Create, nullptr); } ScHFEditSharedHeaderDlg::ScHFEditSharedHeaderDlg( - vcl::Window* pParent, + weld::Window* pParent, const SfxItemSet& rCoreSet, const OUString& rPageStyle) : ScHFEditDlg( pParent, rCoreSet, rPageStyle, - "SharedHeaderDialog", "modules/scalc/ui/sharedheaderdialog.ui" ) + "modules/scalc/ui/sharedheaderdialog.ui", "SharedHeaderDialog" ) { - AddTabPage( "header", ScRightHeaderEditPage::Create ); - AddTabPage( "footerright", ScRightFooterEditPage::Create ); - AddTabPage( "footerleft", ScLeftFooterEditPage::Create ); + AddTabPage("header", ScRightHeaderEditPage::Create, nullptr); + AddTabPage("footerright", ScRightFooterEditPage::Create, nullptr); + AddTabPage("footerleft", ScLeftFooterEditPage::Create, nullptr); } ScHFEditSharedFooterDlg::ScHFEditSharedFooterDlg( - vcl::Window* pParent, + weld::Window* pParent, const SfxItemSet& rCoreSet, const OUString& rPageStyle) : ScHFEditDlg( pParent, rCoreSet, rPageStyle, - "SharedFooterDialog", "modules/scalc/ui/sharedfooterdialog.ui" ) + "modules/scalc/ui/sharedfooterdialog.ui", "SharedFooterDialog" ) { - AddTabPage( "headerright", ScRightHeaderEditPage::Create ); - AddTabPage( "headerleft", ScLeftHeaderEditPage::Create ); - AddTabPage( "footer", ScRightFooterEditPage::Create ); + AddTabPage("headerright", ScRightHeaderEditPage::Create, nullptr); + AddTabPage("headerleft", ScLeftHeaderEditPage::Create, nullptr); + AddTabPage("footer", ScRightFooterEditPage::Create, nullptr); } ScHFEditAllDlg::ScHFEditAllDlg( - vcl::Window* pParent, + weld::Window* pParent, const SfxItemSet& rCoreSet, const OUString& rPageStyle) : ScHFEditDlg( pParent, rCoreSet, rPageStyle, - "AllHeaderFooterDialog", "modules/scalc/ui/allheaderfooterdialog.ui" ) + "modules/scalc/ui/allheaderfooterdialog.ui", "AllHeaderFooterDialog" ) { - AddTabPage( "headerright", ScRightHeaderEditPage::Create ); - AddTabPage( "headerleft", ScLeftHeaderEditPage::Create ); - AddTabPage( "footerright", ScRightFooterEditPage::Create ); - AddTabPage( "footerleft", ScLeftFooterEditPage::Create ); + AddTabPage("headerright", ScRightHeaderEditPage::Create, nullptr); + AddTabPage("headerleft", ScLeftHeaderEditPage::Create, nullptr); + AddTabPage("footerright", ScRightFooterEditPage::Create, nullptr); + AddTabPage("footerleft", ScLeftFooterEditPage::Create, nullptr); } ScHFEditActiveDlg::ScHFEditActiveDlg( - vcl::Window* pParent, + weld::Window* pParent, const SfxItemSet& rCoreSet, const OUString& rPageStyle) : ScHFEditDlg( pParent, rCoreSet, rPageStyle, - "HeaderFooterDialog", "modules/scalc/ui/headerfooterdialog.ui" ) + "modules/scalc/ui/headerfooterdialog.ui", "HeaderFooterDialog" ) { const SvxPageItem& rPageItem = static_cast<const SvxPageItem&>( rCoreSet.Get( @@ -158,8 +159,8 @@ ScHFEditActiveDlg::ScHFEditActiveDlg( if ( bRightPage ) { - AddTabPage( "header", ScRightHeaderEditPage::Create ); - AddTabPage( "footer", ScRightFooterEditPage::Create ); + AddTabPage("header", ScRightHeaderEditPage::Create, nullptr); + AddTabPage("footer", ScRightFooterEditPage::Create, nullptr); } else { @@ -168,20 +169,20 @@ ScHFEditActiveDlg::ScHFEditActiveDlg( bool bShareHeader = rCoreSet.Get(ATTR_PAGE_HEADERSET).GetItemSet(). Get(ATTR_PAGE_SHARED).GetValue(); if ( bShareHeader ) - AddTabPage( "header", ScRightHeaderEditPage::Create ); + AddTabPage("header", ScRightHeaderEditPage::Create, nullptr); else - AddTabPage( "header", ScLeftHeaderEditPage::Create ); + AddTabPage("header", ScLeftHeaderEditPage::Create, nullptr); bool bShareFooter = rCoreSet.Get(ATTR_PAGE_FOOTERSET).GetItemSet(). Get(ATTR_PAGE_SHARED).GetValue(); if ( bShareFooter ) - AddTabPage( "footer", ScRightFooterEditPage::Create ); + AddTabPage("footer", ScRightFooterEditPage::Create, nullptr); else - AddTabPage( "footer", ScLeftFooterEditPage::Create ); + AddTabPage("footer", ScLeftFooterEditPage::Create, nullptr); } } -void ScHFEditDlg::PageCreated( sal_uInt16 /* nId */, SfxTabPage& rPage ) +void ScHFEditDlg::PageCreated(const OString& /* rId */, SfxTabPage& rPage) { // Can only be a ScHFEditPage... diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx index bac0f9a26c18..786405fe2918 100644 --- a/sc/source/ui/pagedlg/tphf.cxx +++ b/sc/source/ui/pagedlg/tphf.cxx @@ -182,7 +182,7 @@ IMPL_LINK_NOARG(ScHFPage, HFEditHdl, void*, void) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg( - this, aDataSet, aStrPageStyle, nResId)); + GetDialogFrameWeld(), aDataSet, aStrPageStyle, nResId)); pDlg->StartExecuteAsync([this, pDlg](sal_Int32 nResult){ if ( nResult == RET_OK ) { |