diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-09-20 10:48:14 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-09-20 13:58:04 +0200 |
commit | 6b5b2bbdf88aec54fc648a019e544addabdece6b (patch) | |
tree | e68b5cde19f16d3b022428c532d50e7c9bdd9e1f /sw/source/ui | |
parent | b613eeeb566adc8955248c31b94a7ed32ebba4d1 (diff) |
weld SwDropCapsDlg
Change-Id: Ibd01c0fb54f0e3b361d5e1f196bfeb44a1fcb99c
Reviewed-on: https://gerrit.libreoffice.org/60805
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/chrdlg/drpcps.cxx | 11 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 39 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.hxx | 16 |
3 files changed, 57 insertions, 9 deletions
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<SwDropCapsPage> pNewPage( static_cast<SwDropCapsPage*>( SwDropCapsPage::Create(get_content_area(), &rSet).get() ) ); - pNewPage->SetFormat(false); - SetTabPage(pNewPage); + TabPageParent pPageParent(get_content_area(), this); + VclPtr<SwDropCapsPage> xNewPage(static_cast<SwDropCapsPage*>(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<SfxAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwAddressAbstractD return VclPtr<SwAbstractSfxDialog_Impl>::Create(pDlg); } -VclPtr<SfxAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwDropCapsDialog( vcl::Window* pParent, +VclPtr<SfxAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwDropCapsDialog(weld::Window* pParent, const SfxItemSet& rSet) { - VclPtr<SfxModalDialog> pDlg = VclPtr<SwDropCapsDlg>::Create(pParent, rSet); - return VclPtr<SwAbstractSfxDialog_Impl>::Create( pDlg ); + return VclPtr<SwAbstractSfxController_Impl>::Create(o3tl::make_unique<SwDropCapsDlg>(pParent, rSet)); } VclPtr<SfxAbstractDialog> 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<SfxSingleTabDialogController> m_xDlg; +public: + explicit SwAbstractSfxController_Impl(std::unique_ptr<SfxSingleTabDialogController> 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<SfxAbstractDialog> CreateNumFormatDialog(vcl::Window* pParent, const SfxItemSet& rAttr) override; - virtual VclPtr<SfxAbstractDialog> CreateSwDropCapsDialog(vcl::Window* pParent, const SfxItemSet& rSet) override; + virtual VclPtr<SfxAbstractDialog> CreateSwDropCapsDialog(weld::Window* pParent, const SfxItemSet& rSet) override; virtual VclPtr<SfxAbstractDialog> CreateSwBackgroundDialog(vcl::Window* pParent, const SfxItemSet& rSet) override; virtual VclPtr<AbstractSwWordCountFloatDlg> CreateSwWordCountDialog(SfxBindings* pBindings, SfxChildWindow* pChild, vcl::Window *pParent, SfxChildWinInfo* pInfo) override; |