From 60f3e4b843da89678e022eed837ee66e726b1920 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 20 Apr 2018 11:06:07 +0100 Subject: place an intermediate class as parent for SfxTabPages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit so a SfxTabPage can be parented by a vcl::Window or a welded native notebook tabpage. That ways the same SfxTabPage can be used at the same time in both a native dialog or a vcl dialog. The impl can be changed to the weld api, and when hosted in a native dialog the vcl impl of that will be instantiated, while native otherwise. e.g. print options appearing in print options dialog and general options. This allows incremental changeover. Change-Id: I6f1fed1e8d0898b01853bb878757bad41cbf9bba Reviewed-on: https://gerrit.libreoffice.org/53193 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/source/ui/dialog/addrdlg.cxx | 3 ++- sw/source/ui/dialog/docstdlg.cxx | 4 ++-- sw/source/ui/dialog/uiregionsw.cxx | 12 ++++++------ 3 files changed, 10 insertions(+), 9 deletions(-) (limited to 'sw/source/ui/dialog') diff --git a/sw/source/ui/dialog/addrdlg.cxx b/sw/source/ui/dialog/addrdlg.cxx index d2d43389cafd..fc4e2e37c465 100644 --- a/sw/source/ui/dialog/addrdlg.cxx +++ b/sw/source/ui/dialog/addrdlg.cxx @@ -20,6 +20,7 @@ #include #include #include +#include SwAddrDlg::SwAddrDlg(vcl::Window* pParent, const SfxItemSet& rSet) : SfxSingleTabDialog(pParent, rSet) @@ -29,7 +30,7 @@ SwAddrDlg::SwAddrDlg(vcl::Window* pParent, const SfxItemSet& rSet) ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SFXPAGE_GENERAL ); if ( fnCreatePage ) { - VclPtr pPage2 = (*fnCreatePage)(get_content_area(), &rSet); + VclPtr pPage2 = (*fnCreatePage)(TabPageParent(get_content_area()), &rSet); SetTabPage(pPage2); } } diff --git a/sw/source/ui/dialog/docstdlg.cxx b/sw/source/ui/dialog/docstdlg.cxx index 841a08d237c0..5ac763710466 100644 --- a/sw/source/ui/dialog/docstdlg.cxx +++ b/sw/source/ui/dialog/docstdlg.cxx @@ -34,9 +34,9 @@ #include #include -VclPtr SwDocStatPage::Create(vcl::Window *pParent, const SfxItemSet *rSet) +VclPtr SwDocStatPage::Create(TabPageParent pParent, const SfxItemSet *rSet) { - return VclPtr::Create(pParent, *rSet); + return VclPtr::Create(pParent.pParent, *rSet); } SwDocStatPage::SwDocStatPage(vcl::Window *pParent, const SfxItemSet &rSet) diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 81765b9cdd01..025f9b90ecde 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -1672,10 +1672,10 @@ void SwInsertSectionTabPage::Reset( const SfxItemSet* ) { } -VclPtr SwInsertSectionTabPage::Create( vcl::Window* pParent, +VclPtr SwInsertSectionTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr::Create(pParent, *rAttrSet); + return VclPtr::Create(pParent.pParent, *rAttrSet); } IMPL_LINK( SwInsertSectionTabPage, ChangeHideHdl, Button *, pBox, void ) @@ -2030,10 +2030,10 @@ void SwSectionFootnoteEndTabPage::Reset( const SfxItemSet* rSet ) ResetState( false, rSet->Get( RES_END_AT_TXTEND, false )); } -VclPtr SwSectionFootnoteEndTabPage::Create( vcl::Window* pParent, +VclPtr SwSectionFootnoteEndTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr::Create(pParent, *rAttrSet); + return VclPtr::Create(pParent.pParent, *rAttrSet); } IMPL_LINK( SwSectionFootnoteEndTabPage, FootEndHdl, Button *, pBox, void ) @@ -2199,9 +2199,9 @@ void SwSectionIndentTabPage::Reset( const SfxItemSet* rSet) IndentModifyHdl(*m_pBeforeMF); } -VclPtr SwSectionIndentTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet) +VclPtr SwSectionIndentTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr::Create(pParent, *rAttrSet); + return VclPtr::Create(pParent.pParent, *rAttrSet); } void SwSectionIndentTabPage::SetWrtShell(SwWrtShell const & rSh) -- cgit