diff options
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 14 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.hxx | 13 | ||||
-rw-r--r-- | sw/source/ui/envelp/mailmrge.cxx | 14 | ||||
-rw-r--r-- | sw/source/uibase/inc/mailmrge.hxx | 9 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view2.cxx | 2 |
5 files changed, 27 insertions, 25 deletions
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index e8eb7119af93..6dca63b32f43 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -214,7 +214,12 @@ short AbstractJavaEditDialog_Impl::Execute() IMPL_ABSTDLG_BASE(AbstractMailMergeDlg_Impl); IMPL_ABSTDLG_BASE(AbstractMailMergeCreateFromDlg_Impl); -IMPL_ABSTDLG_BASE(AbstractMailMergeFieldConnectionsDlg_Impl); + +short AbstractMailMergeFieldConnectionsDlg_Impl::Execute() +{ + return m_xDlg->run(); +} + IMPL_ABSTDLG_BASE(AbstractMultiTOXTabDialog_Impl); IMPL_ABSTDLG_BASE(AbstractEditRegionDlg_Impl); IMPL_ABSTDLG_BASE(AbstractInsertSectionTabDialog_Impl); @@ -637,7 +642,7 @@ bool AbstractMailMergeCreateFromDlg_Impl::IsThisDocument() const bool AbstractMailMergeFieldConnectionsDlg_Impl::IsUseExistingConnections() const { - return pDlg->IsUseExistingConnections(); + return m_xDlg->IsUseExistingConnections(); } CurTOXType AbstractMultiTOXTabDialog_Impl::GetCurrentTOXType() const @@ -1040,10 +1045,9 @@ VclPtr<AbstractMailMergeCreateFromDlg> SwAbstractDialogFactory_Impl::CreateMailM return VclPtr<AbstractMailMergeCreateFromDlg_Impl>::Create(pDlg); } -VclPtr<AbstractMailMergeFieldConnectionsDlg> SwAbstractDialogFactory_Impl::CreateMailMergeFieldConnectionsDlg(vcl::Window* pParent) +VclPtr<AbstractMailMergeFieldConnectionsDlg> SwAbstractDialogFactory_Impl::CreateMailMergeFieldConnectionsDlg(weld::Window* pParent) { - VclPtr<SwMailMergeFieldConnectionsDlg> pDlg = VclPtr<SwMailMergeFieldConnectionsDlg>::Create( pParent ); - return VclPtr<AbstractMailMergeFieldConnectionsDlg_Impl>::Create( pDlg ); + return VclPtr<AbstractMailMergeFieldConnectionsDlg_Impl>::Create(o3tl::make_unique<SwMailMergeFieldConnectionsDlg>(pParent)); } VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateMultiTOXMarkDlg(weld::Window* pParent, SwTOXMgr &rTOXMgr) diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index 6471d1864c4c..07953242d358 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -508,8 +508,15 @@ class AbstractMailMergeCreateFromDlg_Impl : public AbstractMailMergeCreateFromDl class SwMailMergeFieldConnectionsDlg; class AbstractMailMergeFieldConnectionsDlg_Impl : public AbstractMailMergeFieldConnectionsDlg { - DECL_ABSTDLG_BASE(AbstractMailMergeFieldConnectionsDlg_Impl,SwMailMergeFieldConnectionsDlg) - virtual bool IsUseExistingConnections() const override ; +protected: + std::unique_ptr<SwMailMergeFieldConnectionsDlg> m_xDlg; +public: + explicit AbstractMailMergeFieldConnectionsDlg_Impl(std::unique_ptr<SwMailMergeFieldConnectionsDlg> p) + : m_xDlg(std::move(p)) + { + } + virtual short Execute() override; + virtual bool IsUseExistingConnections() const override ; }; class SwMultiTOXTabDialog; @@ -670,7 +677,7 @@ public: sal_Int32 nCommandType, const css::uno::Reference< css::sdbc::XConnection>& xConnection ) override; virtual VclPtr<AbstractMailMergeCreateFromDlg> CreateMailMergeCreateFromDlg(vcl::Window* pParent) override; - virtual VclPtr<AbstractMailMergeFieldConnectionsDlg> CreateMailMergeFieldConnectionsDlg(vcl::Window* pParent) override; + virtual VclPtr<AbstractMailMergeFieldConnectionsDlg> CreateMailMergeFieldConnectionsDlg(weld::Window* pParent) override; virtual VclPtr<VclAbstractDialog> CreateMultiTOXMarkDlg(weld::Window* pParent, SwTOXMgr &rTOXMgr) override; virtual VclPtr<SfxAbstractTabDialog> CreateOutlineTabDialog(weld::Window* pParent, const SfxItemSet* pSwItemSet, SwWrtShell &) override; diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx index 6230ad636d48..9bcd53d6c206 100644 --- a/sw/source/ui/envelp/mailmrge.cxx +++ b/sw/source/ui/envelp/mailmrge.cxx @@ -634,22 +634,14 @@ void SwMailMergeCreateFromDlg::dispose() ModalDialog::dispose(); } -SwMailMergeFieldConnectionsDlg::SwMailMergeFieldConnectionsDlg(vcl::Window* pParent) - : ModalDialog(pParent, "MergeConnectDialog", - "modules/swriter/ui/mergeconnectdialog.ui") +SwMailMergeFieldConnectionsDlg::SwMailMergeFieldConnectionsDlg(weld::Window* pParent) + : GenericDialogController(pParent, "modules/swriter/ui/mergeconnectdialog.ui", "MergeConnectDialog") + , m_xUseExistingRB(m_xBuilder->weld_radio_button("existing")) { - get(m_pUseExistingRB, "existing"); } SwMailMergeFieldConnectionsDlg::~SwMailMergeFieldConnectionsDlg() { - disposeOnce(); -} - -void SwMailMergeFieldConnectionsDlg::dispose() -{ - m_pUseExistingRB.clear(); - ModalDialog::dispose(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/inc/mailmrge.hxx b/sw/source/uibase/inc/mailmrge.hxx index 6a2b5bf53566..23f51e363d8d 100644 --- a/sw/source/uibase/inc/mailmrge.hxx +++ b/sw/source/uibase/inc/mailmrge.hxx @@ -152,17 +152,16 @@ public: } }; -class SwMailMergeFieldConnectionsDlg : public ModalDialog +class SwMailMergeFieldConnectionsDlg : public weld::GenericDialogController { - VclPtr<RadioButton> m_pUseExistingRB; + std::unique_ptr<weld::RadioButton> m_xUseExistingRB; public: - SwMailMergeFieldConnectionsDlg(vcl::Window* pParent); + SwMailMergeFieldConnectionsDlg(weld::Window* pParent); virtual ~SwMailMergeFieldConnectionsDlg() override; - virtual void dispose() override; bool IsUseExistingConnections() const { - return m_pUseExistingRB->IsChecked(); + return m_xUseExistingRB->get_active(); } }; diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index 8d2b1e91eabc..93bc535e9b31 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -2308,7 +2308,7 @@ void SwView::GenerateFormLetter(bool bUseCurrentDocument) { //take an existing data source or create a new one? SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractMailMergeFieldConnectionsDlg> pConnectionsDlg( pFact->CreateMailMergeFieldConnectionsDlg(&GetViewFrame()->GetWindow()) ); + ScopedVclPtr<AbstractMailMergeFieldConnectionsDlg> pConnectionsDlg(pFact->CreateMailMergeFieldConnectionsDlg(GetFrameWeld())); if(RET_OK == pConnectionsDlg->Execute()) bCallAddressPilot = !pConnectionsDlg->IsUseExistingConnections(); else |