diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-09-17 11:45:19 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-09-17 18:12:14 +0200 |
commit | 88582ebee383c63c3fba588924f36ff7655af9c1 (patch) | |
tree | 689037731842d7e3db2d3ccaa60682bd21af7e69 /sd/source | |
parent | fb8d53ee0a5afc6305a988a7dca60d55376f8fcc (diff) |
weld SdCharDlg
Change-Id: If0c072c0a0a1548034dca37258f72294536ec566
Reviewed-on: https://gerrit.libreoffice.org/60578
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/dlg/dlgchar.cxx | 29 | ||||
-rw-r--r-- | sd/source/ui/dlg/sddlgfact.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/dlg/sddlgfact.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/fuchar.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/inc/dlg_char.hxx | 12 |
5 files changed, 20 insertions, 29 deletions
diff --git a/sd/source/ui/dlg/dlgchar.cxx b/sd/source/ui/dlg/dlgchar.cxx index 4075a5995388..5901dd1fe4c8 100644 --- a/sd/source/ui/dlg/dlgchar.cxx +++ b/sd/source/ui/dlg/dlgchar.cxx @@ -30,38 +30,35 @@ /** * Constructor of tab dialog: append pages to dialog */ -SdCharDlg::SdCharDlg( vcl::Window* pParent, const SfxItemSet* pAttr, - const SfxObjectShell* pDocShell ) : - SfxTabDialog ( pParent - ,"DrawCharDialog" - ,"modules/sdraw/ui/drawchardialog.ui" - , pAttr ), - rDocShell ( *pDocShell ) +SdCharDlg::SdCharDlg(weld::Window* pParent, const SfxItemSet* pAttr, + const SfxObjectShell* pDocShell) + : SfxTabDialogController(pParent, "modules/sdraw/ui/drawchardialog.ui", + "DrawCharDialog", pAttr) + , rDocShell(*pDocShell) { - SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - mnCharName = AddTabPage( "RID_SVXPAGE_CHAR_NAME", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), nullptr ); - mnCharEffects = AddTabPage( "RID_SVXPAGE_CHAR_EFFECTS", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), nullptr ); - AddTabPage( "RID_SVXPAGE_CHAR_POSITION", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), nullptr ); - mnCharBackground = AddTabPage( "RID_SVXPAGE_BACKGROUND", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), nullptr ); + AddTabPage("RID_SVXPAGE_CHAR_NAME", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_CHAR_NAME), nullptr); + AddTabPage("RID_SVXPAGE_CHAR_EFFECTS", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_CHAR_EFFECTS), nullptr); + AddTabPage("RID_SVXPAGE_CHAR_POSITION", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_CHAR_POSITION), nullptr); + AddTabPage("RID_SVXPAGE_BACKGROUND", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_BACKGROUND), nullptr); } -void SdCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) +void SdCharDlg::PageCreated(const OString& rId, SfxTabPage &rPage) { SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); - if (nId == mnCharName) + if (rId == "RID_SVXPAGE_CHAR_NAME") { SvxFontListItem aItem(* static_cast<const SvxFontListItem*>( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ); aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST)); rPage.PageCreated(aSet); } - else if (nId == mnCharEffects) + else if (rId == "RID_SVXPAGE_CHAR_EFFECTS") { rPage.PageCreated(aSet); } - else if (nId == mnCharBackground) + else if (rId == "RID_SVXPAGE_BACKGROUND") { aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,static_cast<sal_uInt32>(SvxBackgroundTabFlags::SHOW_CHAR_BKGCOLOR))); rPage.PageCreated(aSet); diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx index 7173bfc0c533..f6640e06d42b 100644 --- a/sd/source/ui/dlg/sddlgfact.cxx +++ b/sd/source/ui/dlg/sddlgfact.cxx @@ -384,9 +384,9 @@ VclPtr<AbstractSdCustomShowDlg> SdAbstractDialogFactory_Impl::CreateSdCustomShow return VclPtr<AbstractSdCustomShowDlg_Impl>::Create(o3tl::make_unique<SdCustomShowDlg>(pParent, rDrawDoc)); } -VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdTabCharDialog(vcl::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell ) +VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdTabCharDialog(weld::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell) { - return VclPtr<SdAbstractTabDialog_Impl>::Create( VclPtr<SdCharDlg>::Create(pParent, pAttr, pDocShell) ); + return VclPtr<SdAbstractTabController_Impl>::Create(o3tl::make_unique<SdCharDlg>(pParent, pAttr, pDocShell)); } VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdTabPageDialog(weld::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell, bool bAreaPage ) diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx index 16c0b0be361d..706bedb9854e 100644 --- a/sd/source/ui/dlg/sddlgfact.hxx +++ b/sd/source/ui/dlg/sddlgfact.hxx @@ -310,7 +310,7 @@ public: virtual VclPtr<VclAbstractDialog> CreateBreakDlg(weld::Window* pWindow, ::sd::DrawView* pDrView, ::sd::DrawDocShell* pShell, sal_uLong nSumActionCount, sal_uLong nObjCount) override; virtual VclPtr<AbstractCopyDlg> CreateCopyDlg(vcl::Window* pParent, const SfxItemSet& rInAttrs, ::sd::View* pView) override; virtual VclPtr<AbstractSdCustomShowDlg> CreateSdCustomShowDlg(weld::Window* pParent, SdDrawDocument& rDrawDoc) override; - virtual VclPtr<SfxAbstractTabDialog> CreateSdTabCharDialog(vcl::Window* pWindow, const SfxItemSet* pAttr, SfxObjectShell* pDocShell) override; + virtual VclPtr<SfxAbstractTabDialog> CreateSdTabCharDialog(weld::Window* pWindow, const SfxItemSet* pAttr, SfxObjectShell* pDocShell) override; virtual VclPtr<SfxAbstractTabDialog> CreateSdTabPageDialog(weld::Window* pWindow, const SfxItemSet* pAttr, SfxObjectShell* pDocShell, bool bAreaPage) override; virtual VclPtr<AbstractSdModifyFieldDlg> CreateSdModifyFieldDlg(weld::Window* pWindow, const SvxFieldData* pInField, const SfxItemSet& rSet) override; virtual VclPtr<AbstractSdSnapLineDlg> CreateSdSnapLineDlg(weld::Window* pParent, const SfxItemSet& rInAttrs, ::sd::View* pView) override; diff --git a/sd/source/ui/func/fuchar.cxx b/sd/source/ui/func/fuchar.cxx index f53afb018762..4ad60edfdfa9 100644 --- a/sd/source/ui/func/fuchar.cxx +++ b/sd/source/ui/func/fuchar.cxx @@ -72,7 +72,7 @@ void FuChar::DoExecute( SfxRequest& rReq ) aNewAttr.Put( aEditAttr, false ); SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - ScopedVclPtr<SfxAbstractTabDialog> pDlg( pFact->CreateSdTabCharDialog(mpViewShell->GetActiveWindow(), &aNewAttr, mpDoc->GetDocSh() ) ); + ScopedVclPtr<SfxAbstractTabDialog> pDlg( pFact->CreateSdTabCharDialog(mpViewShell->GetFrameWeld(), &aNewAttr, mpDoc->GetDocSh() ) ); if (rReq.GetSlot() == SID_CHAR_DLG_EFFECT) { pDlg->SetCurPageId("RID_SVXPAGE_CHAR_EFFECTS"); diff --git a/sd/source/ui/inc/dlg_char.hxx b/sd/source/ui/inc/dlg_char.hxx index 22335ed44ee9..f56a2e6e64cf 100644 --- a/sd/source/ui/inc/dlg_char.hxx +++ b/sd/source/ui/inc/dlg_char.hxx @@ -28,21 +28,15 @@ class SfxObjectShell; /** * Character-Tab-Dialog */ -class SdCharDlg : public SfxTabDialog +class SdCharDlg : public SfxTabDialogController { private: - sal_uInt16 mnCharName; - sal_uInt16 mnCharEffects; - sal_uInt16 mnCharBackground; - const SfxObjectShell& rDocShell; - virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) override; + virtual void PageCreated(const OString& rId, SfxTabPage &rPage) override; public: - - SdCharDlg( vcl::Window* pParent, const SfxItemSet* pAttr, - const SfxObjectShell* pDocShell ); + SdCharDlg(weld::Window* pParent, const SfxItemSet* pAttr, const SfxObjectShell* pDocShell); }; #endif // INCLUDED_SD_SOURCE_UI_INC_DLG_CHAR_HXX |