From 1e6b6f038af656b475cb87844822287fd4e6c166 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 26 Sep 2018 13:38:50 +0100 Subject: weld SvxFormatCellsDialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I236ddc4f58b882e648512a99306440fa88a3aeeb Reviewed-on: https://gerrit.libreoffice.org/61017 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- cui/source/dialogs/sdrcelldlg.cxx | 17 +++-- cui/source/factory/dlgfact.cxx | 4 +- cui/source/factory/dlgfact.hxx | 2 +- cui/source/inc/sdrcelldlg.hxx | 9 +-- cui/uiconfig/ui/formatcellsdialog.ui | 129 +++++++++++++++++++++++++++++++---- 5 files changed, 130 insertions(+), 31 deletions(-) (limited to 'cui') diff --git a/cui/source/dialogs/sdrcelldlg.cxx b/cui/source/dialogs/sdrcelldlg.cxx index 47dd49cbc6a5..e20a3f488209 100644 --- a/cui/source/dialogs/sdrcelldlg.cxx +++ b/cui/source/dialogs/sdrcelldlg.cxx @@ -25,25 +25,24 @@ #include #include -SvxFormatCellsDialog::SvxFormatCellsDialog( vcl::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel ) - : SfxTabDialog(pParent, "FormatCellsDialog", "cui/ui/formatcellsdialog.ui", pAttr) +SvxFormatCellsDialog::SvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel) + : SfxTabDialogController(pParent, "cui/ui/formatcellsdialog.ui", "FormatCellsDialog", pAttr) , mrOutAttrs(*pAttr) , mpColorTab(rModel.GetColorList()) , mpGradientList(rModel.GetGradientList()) , mpHatchingList(rModel.GetHatchList()) , mpBitmapList(rModel.GetBitmapList()) , mpPatternList(rModel.GetPatternList()) - , m_nAreaPageId(0) { AddTabPage("name", RID_SVXPAGE_CHAR_NAME); AddTabPage("effects", RID_SVXPAGE_CHAR_EFFECTS); - m_nBorderPageId = AddTabPage("border", RID_SVXPAGE_BORDER ); - m_nAreaPageId = AddTabPage("area", RID_SVXPAGE_AREA); + AddTabPage("border", RID_SVXPAGE_BORDER ); + AddTabPage("area", RID_SVXPAGE_AREA); } -void SvxFormatCellsDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) +void SvxFormatCellsDialog::PageCreated(const OString& rId, SfxTabPage &rPage) { - if (nId == m_nAreaPageId) + if (rId == "area") { SvxAreaTabPage& rAreaPage = static_cast(rPage); rAreaPage.SetColorList( mpColorTab ); @@ -53,13 +52,13 @@ void SvxFormatCellsDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) rAreaPage.SetPatternList( mpPatternList );; rAreaPage.ActivatePage( mrOutAttrs ); } - else if (nId == m_nBorderPageId) + else if (rId == "border") { SvxBorderTabPage& rBorderPage = static_cast(rPage); rBorderPage.SetTableMode(); } else - SfxTabDialog::PageCreated( nId, rPage ); + SfxTabDialogController::PageCreated(rId, rPage); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index d32d0a817e90..e48e1f87d11c 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1618,9 +1618,9 @@ VclPtr AbstractDialogFactory_Impl::CreateLinksDialog( vc return VclPtr::Create( pLinkDlg ); } -VclPtr AbstractDialogFactory_Impl::CreateSvxFormatCellsDialog( const SfxItemSet* pAttr, const SdrModel& rModel, const SdrObject* /*pObj*/ ) +VclPtr AbstractDialogFactory_Impl::CreateSvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel, const SdrObject* /*pObj*/) { - return VclPtr::Create( VclPtr::Create( nullptr, pAttr, rModel ) ); + return VclPtr::Create(o3tl::make_unique(pParent, pAttr, rModel)); } VclPtr AbstractDialogFactory_Impl::CreateSvxSplitTableDialog(weld::Window* pParent, bool bIsTableVertical, long nMaxVertical) diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index 3a1acd506334..2316ff7be199 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -824,7 +824,7 @@ public: const sal_uInt16 _nInitiallySelectedEvent ) override; - virtual VclPtr CreateSvxFormatCellsDialog( const SfxItemSet* pAttr, const SdrModel& rModel, const SdrObject* pObj ) override; + virtual VclPtr CreateSvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel, const SdrObject* pObj) override; virtual VclPtr CreateSvxSplitTableDialog(weld::Window* pParent, bool bIsTableVertical, long nMaxVertical) override; diff --git a/cui/source/inc/sdrcelldlg.hxx b/cui/source/inc/sdrcelldlg.hxx index 0a38f759a494..50ab4b39ac70 100644 --- a/cui/source/inc/sdrcelldlg.hxx +++ b/cui/source/inc/sdrcelldlg.hxx @@ -25,7 +25,7 @@ #include class SdrModel; -class SvxFormatCellsDialog : public SfxTabDialog +class SvxFormatCellsDialog : public SfxTabDialogController { private: const SfxItemSet& mrOutAttrs; @@ -36,13 +36,10 @@ private: XBitmapListRef mpBitmapList; XPatternListRef mpPatternList; - sal_uInt16 m_nAreaPageId; - sal_uInt16 m_nBorderPageId; - public: - SvxFormatCellsDialog( vcl::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel ); + SvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel); - virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) override; + virtual void PageCreated(const OString& rId, SfxTabPage &rPage) override; }; diff --git a/cui/uiconfig/ui/formatcellsdialog.ui b/cui/uiconfig/ui/formatcellsdialog.ui index a07b314394de..741a401c122d 100644 --- a/cui/uiconfig/ui/formatcellsdialog.ui +++ b/cui/uiconfig/ui/formatcellsdialog.ui @@ -1,5 +1,5 @@ - + @@ -7,7 +7,13 @@ 6 Table Properties False + True + 0 + 0 dialog + + + False @@ -18,12 +24,10 @@ False end - - gtk-ok + + gtk-revert-to-saved True True - True - True True True @@ -34,10 +38,12 @@ - - gtk-cancel + + gtk-ok True True + True + True True True @@ -48,8 +54,8 @@ - - gtk-help + + gtk-cancel True True True @@ -59,12 +65,11 @@ False True 2 - True - - gtk-revert-to-saved + + gtk-help True True True @@ -74,6 +79,7 @@ False True 3 + True @@ -90,6 +96,7 @@ False True True + True True @@ -97,6 +104,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -116,6 +147,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + 1 @@ -139,6 +194,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + 2 @@ -162,6 +241,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + 3 @@ -188,10 +291,10 @@ + reset ok cancel help - reset -- cgit