From 6b5b2bbdf88aec54fc648a019e544addabdece6b Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 20 Sep 2018 10:48:14 +0100 Subject: weld SwDropCapsDlg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ibd01c0fb54f0e3b361d5e1f196bfeb44a1fcb99c Reviewed-on: https://gerrit.libreoffice.org/60805 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/source/ui/chrdlg/drpcps.cxx | 11 ++++++----- sw/source/ui/dialog/swdlgfact.cxx | 39 ++++++++++++++++++++++++++++++++++++--- sw/source/ui/dialog/swdlgfact.hxx | 16 +++++++++++++++- 3 files changed, 57 insertions(+), 9 deletions(-) (limited to 'sw/source/ui') diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index 9395eae6ba55..94143c79e721 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -448,12 +448,13 @@ void SwDropCapsPict::InitPrinter_() } } -SwDropCapsDlg::SwDropCapsDlg(vcl::Window *pParent, const SfxItemSet &rSet ) - : SfxSingleTabDialog(pParent, rSet) +SwDropCapsDlg::SwDropCapsDlg(weld::Window *pParent, const SfxItemSet &rSet) + : SfxSingleTabDialogController(pParent, rSet) { - VclPtr pNewPage( static_cast( SwDropCapsPage::Create(get_content_area(), &rSet).get() ) ); - pNewPage->SetFormat(false); - SetTabPage(pNewPage); + TabPageParent pPageParent(get_content_area(), this); + VclPtr xNewPage(static_cast(SwDropCapsPage::Create(pPageParent, &rSet).get())); + xNewPage->SetFormat(false); + SetTabPage(xNewPage); } SwDropCapsPage::SwDropCapsPage(TabPageParent pParent, const SfxItemSet &rSet) diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index d61bb53c4f90..aabfaff6a42c 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -90,56 +90,76 @@ using namespace css::uno; IMPL_ABSTDLG_BASE(AbstractSwWordCountFloatDlg_Impl); IMPL_ABSTDLG_BASE(AbstractSwInsertAbstractDlg_Impl); IMPL_ABSTDLG_BASE(SwAbstractSfxDialog_Impl); + +short SwAbstractSfxController_Impl::Execute() +{ + return m_xDlg->run(); +} + short AbstractSwAsciiFilterDlg_Impl::Execute() { return m_xDlg->run(); } + IMPL_ABSTDLG_BASE(VclAbstractDialog_Impl); + short AbstractSplitTableDialog_Impl::Execute() { return m_xDlg->execute(); } + short AbstractSwBreakDlg_Impl::Execute() { return m_xDlg->execute(); } + short AbstractSwTableWidthDlg_Impl::Execute() { return m_xDlg->execute(); } + short AbstractSwTableHeightDlg_Impl::Execute() { return m_xDlg->execute(); } + short AbstractSwMergeTableDlg_Impl::Execute() { return m_xDlg->execute(); } + short AbstractGenericDialog_Impl::Execute() { return m_xDlg->run(); } + bool AbstractGenericDialog_Impl::StartExecuteAsync(AsyncContext &rCtx) { return weld::GenericDialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); } + short AbstractSwSortDlg_Impl::Execute() { return m_xDlg->execute(); } + short AbstractMultiTOXMarkDlg_Impl::Execute() { return m_xDlg->execute(); } + short AbstractTabController_Impl::Execute() { return m_xDlg->execute(); } + IMPL_ABSTDLG_BASE(AbstractTabDialog_Impl); + short AbstractSwConvertTableDlg_Impl::Execute() { return m_xDlg->run(); } + IMPL_ABSTDLG_BASE(AbstractSwInsertDBColAutoPilot_Impl); short AbstractDropDownFieldDialog_Impl::Execute() @@ -153,15 +173,19 @@ short AbstractSwLabDlg_Impl::Execute() } IMPL_ABSTDLG_BASE(AbstractSwSelGlossaryDlg_Impl); + short AbstractSwAutoFormatDlg_Impl::Execute() { return m_xDlg->execute(); } + IMPL_ABSTDLG_BASE(AbstractSwFieldDlg_Impl); + short AbstractSwRenameXNamedDlg_Impl::Execute() { return m_xDlg->run(); } + IMPL_ABSTDLG_BASE(AbstractSwModalRedlineAcceptDlg_Impl); IMPL_ABSTDLG_BASE(AbstractGlossaryDlg_Impl); @@ -295,6 +319,16 @@ void SwAbstractSfxDialog_Impl::SetText( const OUString& rStr ) pDlg->SetText( rStr ); } +const SfxItemSet* SwAbstractSfxController_Impl::GetOutputItemSet() const +{ + return m_xDlg->GetOutputItemSet(); +} + +void SwAbstractSfxController_Impl::SetText(const OUString& rStr) +{ + m_xDlg->set_title(rStr); +} + void AbstractSwAsciiFilterDlg_Impl::FillOptions( SwAsciiOptions& rOptions ) { m_xDlg->FillOptions(rOptions); @@ -724,11 +758,10 @@ VclPtr SwAbstractDialogFactory_Impl::CreateSwAddressAbstractD return VclPtr::Create(pDlg); } -VclPtr SwAbstractDialogFactory_Impl::CreateSwDropCapsDialog( vcl::Window* pParent, +VclPtr SwAbstractDialogFactory_Impl::CreateSwDropCapsDialog(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::CreateSwBackgroundDialog( vcl::Window* pParent, diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index 5c8fad67722e..27dacb7c419e 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -94,6 +94,20 @@ class SwAbstractSfxDialog_Impl :public SfxAbstractDialog virtual void SetText( const OUString& rStr ) override; }; +class SwAbstractSfxController_Impl : public SfxAbstractDialog +{ +protected: + std::unique_ptr m_xDlg; +public: + explicit SwAbstractSfxController_Impl(std::unique_ptr p) + : m_xDlg(std::move(p)) + { + } + virtual short Execute() override; + virtual const SfxItemSet* GetOutputItemSet() const override; + virtual void SetText(const OUString& rStr) override; +}; + class AbstractSwAsciiFilterDlg_Impl : public AbstractSwAsciiFilterDlg { protected: @@ -560,7 +574,7 @@ public: virtual ~SwAbstractDialogFactory_Impl() {} virtual VclPtr CreateNumFormatDialog(vcl::Window* pParent, const SfxItemSet& rAttr) override; - virtual VclPtr CreateSwDropCapsDialog(vcl::Window* pParent, const SfxItemSet& rSet) override; + virtual VclPtr CreateSwDropCapsDialog(weld::Window* pParent, const SfxItemSet& rSet) override; virtual VclPtr CreateSwBackgroundDialog(vcl::Window* pParent, const SfxItemSet& rSet) override; virtual VclPtr CreateSwWordCountDialog(SfxBindings* pBindings, SfxChildWindow* pChild, vcl::Window *pParent, SfxChildWinInfo* pInfo) override; -- cgit