From bbeeedbbfa0b7a0d1461c5ff703721bce1b7f80a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 28 Sep 2018 14:54:44 +0100 Subject: weld SwNumFormatDlg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8f7acf1b662d2357f810ff3c103670df2e58757f Reviewed-on: https://gerrit.libreoffice.org/61089 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- cui/uiconfig/ui/formatnumberdialog.ui | 8 +++++++- sw/inc/swabstdlg.hxx | 3 +-- sw/source/ui/chrdlg/tblnumfm.cxx | 17 ++++++++--------- sw/source/ui/dialog/swdlgfact.cxx | 6 ++---- sw/source/ui/dialog/swdlgfact.hxx | 2 +- sw/source/uibase/inc/tblnumfm.hxx | 6 +++--- sw/source/uibase/shells/tabsh.cxx | 2 +- sw/source/uibase/utlui/numfmtlb.cxx | 2 +- 8 files changed, 24 insertions(+), 22 deletions(-) diff --git a/cui/uiconfig/ui/formatnumberdialog.ui b/cui/uiconfig/ui/formatnumberdialog.ui index fd01522e1800..13be59a2c0b6 100644 --- a/cui/uiconfig/ui/formatnumberdialog.ui +++ b/cui/uiconfig/ui/formatnumberdialog.ui @@ -1,5 +1,5 @@ - + @@ -7,7 +7,13 @@ 6 Format Number False + True + 0 + 0 dialog + + + False diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index e9f201a35ffb..da2486e48b71 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -359,8 +359,7 @@ class SwAbstractDialogFactory public: static SwAbstractDialogFactory* Create(); - virtual VclPtr CreateNumFormatDialog( vcl::Window* pParent, - const SfxItemSet& rAttr) = 0; + virtual VclPtr CreateNumFormatDialog(weld::Window* pParent, const SfxItemSet& rAttr) = 0; virtual VclPtr CreateSwDropCapsDialog(weld::Window* pParent, const SfxItemSet& rSet) = 0; virtual VclPtr CreateSwBackgroundDialog(weld::Window* pParent, const SfxItemSet& rSet) = 0; diff --git a/sw/source/ui/chrdlg/tblnumfm.cxx b/sw/source/ui/chrdlg/tblnumfm.cxx index ddcad7961029..46fe5c8455e4 100644 --- a/sw/source/ui/chrdlg/tblnumfm.cxx +++ b/sw/source/ui/chrdlg/tblnumfm.cxx @@ -27,21 +27,20 @@ #include #include -SwNumFormatDlg::SwNumFormatDlg(vcl::Window* pParent, const SfxItemSet& rSet) - : SfxSingleTabDialog(pParent, rSet, "FormatNumberDialog", - "cui/ui/formatnumberdialog.ui") +SwNumFormatDlg::SwNumFormatDlg(weld::Window* pParent, const SfxItemSet& rSet) + : SfxSingleTabDialogController(pParent, rSet, "cui/ui/formatnumberdialog.ui", "FormatNumberDialog") { // Create TabPage SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ); - + ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc(RID_SVXPAGE_NUMBERFORMAT); if ( fnCreatePage ) { - VclPtr pNewPage = (*fnCreatePage)( TabPageParent(get_content_area()), &rSet ); + TabPageParent pPageParent(get_content_area(), this); + VclPtr xNewPage = (*fnCreatePage)(pPageParent, &rSet); SfxAllItemSet aSet(*(rSet.GetPool())); - aSet.Put ( SvxNumberInfoItem( pNewPage->GetItemSet().Get( SID_ATTR_NUMBERFORMAT_INFO ) )); - pNewPage->PageCreated(aSet); - SetTabPage(pNewPage); + aSet.Put(SvxNumberInfoItem(xNewPage->GetItemSet().Get( SID_ATTR_NUMBERFORMAT_INFO))); + xNewPage->PageCreated(aSet); + SetTabPage(xNewPage); } } diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 2a5849a1753e..5e1c01acdacc 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -770,11 +770,9 @@ VclPtr SwAbstractDialogFactory_Impl::CreateSwBackgroundDialog return VclPtr::Create(o3tl::make_unique(pParent, rSet)); } -VclPtr SwAbstractDialogFactory_Impl::CreateNumFormatDialog( vcl::Window* pParent, - const SfxItemSet& rSet) +VclPtr SwAbstractDialogFactory_Impl::CreateNumFormatDialog(weld::Window* pParent, const SfxItemSet& rSet) { - VclPtr pDlg = VclPtr::Create( pParent, rSet ); - return VclPtr::Create( pDlg ); + return VclPtr::Create(o3tl::make_unique(pParent, rSet)); } VclPtr SwAbstractDialogFactory_Impl::CreateSwAsciiFilterDlg(weld::Window* pParent, diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index 7cbb22347371..2ad87e1986dc 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -573,7 +573,7 @@ class SwAbstractDialogFactory_Impl : public SwAbstractDialogFactory public: virtual ~SwAbstractDialogFactory_Impl() {} - virtual VclPtr CreateNumFormatDialog(vcl::Window* pParent, const SfxItemSet& rAttr) override; + virtual VclPtr CreateNumFormatDialog(weld::Window* pParent, const SfxItemSet& rAttr) override; virtual VclPtr CreateSwDropCapsDialog(weld::Window* pParent, const SfxItemSet& rSet) override; virtual VclPtr CreateSwBackgroundDialog(weld::Window* pParent, const SfxItemSet& rSet) override; virtual VclPtr CreateSwWordCountDialog(SfxBindings* pBindings, diff --git a/sw/source/uibase/inc/tblnumfm.hxx b/sw/source/uibase/inc/tblnumfm.hxx index e7c1411acca4..58a8e9621ab1 100644 --- a/sw/source/uibase/inc/tblnumfm.hxx +++ b/sw/source/uibase/inc/tblnumfm.hxx @@ -21,13 +21,13 @@ #include -namespace vcl { class Window; } +namespace weld { class Window; } class SfxItemSet; -class SwNumFormatDlg : public SfxSingleTabDialog +class SwNumFormatDlg : public SfxSingleTabDialogController { public: - SwNumFormatDlg(vcl::Window* pParent, const SfxItemSet& rSet); + SwNumFormatDlg(weld::Window* pParent, const SfxItemSet& rSet); }; #endif diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index 4d89ac332d46..00f1df7a0e2b 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -679,7 +679,7 @@ void SwTableShell::Execute(SfxRequest &rReq) sCurText, SID_ATTR_NUMBERFORMAT_INFO )); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - ScopedVclPtr pDlg(pFact->CreateNumFormatDialog(GetView().GetWindow(), aCoreSet)); + ScopedVclPtr pDlg(pFact->CreateNumFormatDialog(GetView().GetFrameWeld(), aCoreSet)); if (RET_OK == pDlg->Execute()) { diff --git a/sw/source/uibase/utlui/numfmtlb.cxx b/sw/source/uibase/utlui/numfmtlb.cxx index fef26cf61c3b..c9189fed183f 100644 --- a/sw/source/uibase/utlui/numfmtlb.cxx +++ b/sw/source/uibase/utlui/numfmtlb.cxx @@ -371,7 +371,7 @@ IMPL_LINK( NumFormatListBox, SelectHdl, ListBox&, rBox, void ) aCoreSet.Put(SfxBoolItem(SID_ATTR_NUMBERFORMAT_ADD_AUTO, bUseAutomaticLanguage)); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - ScopedVclPtr pDlg(pFact->CreateNumFormatDialog(this, aCoreSet)); + ScopedVclPtr pDlg(pFact->CreateNumFormatDialog(GetFrameWeld(), aCoreSet)); if (RET_OK == pDlg->Execute()) { -- cgit