diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/swabstdlg.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/dbui/mailmergewizard.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 20 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.hxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/app/apphdl.cxx | 10 |
5 files changed, 16 insertions, 24 deletions
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index cf621ad6e89a..642218f530d8 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -344,7 +344,7 @@ public: class SwMailMergeConfigItem; -class AbstractMailMergeWizard : public VclAbstractDialog2 +class AbstractMailMergeWizard : public VclAbstractDialog { protected: virtual ~AbstractMailMergeWizard() override = default; diff --git a/sw/source/ui/dbui/mailmergewizard.cxx b/sw/source/ui/dbui/mailmergewizard.cxx index 5883c910dce0..77535bf54f39 100644 --- a/sw/source/ui/dbui/mailmergewizard.cxx +++ b/sw/source/ui/dbui/mailmergewizard.cxx @@ -245,7 +245,7 @@ short SwMailMergeWizard::Execute() OSL_FAIL("SwMailMergeWizard cannot be executed via Dialog::Execute!\n" "It creates a thread (MailDispatcher instance) that will call" "back to VCL apartment => deadlock!\n" - "Use Dialog::StartExecuteModal to execute the dialog!" ); + "Use Dialog::StartExecuteAsync to execute the dialog!" ); return RET_CANCEL; } diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 39db3b0a1f10..c30b671d3b29 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -721,23 +721,17 @@ void AbstractMailMergeWizard_Impl::dispose() AbstractMailMergeWizard::dispose(); } -void AbstractMailMergeWizard_Impl::StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl ) +bool AbstractMailMergeWizard_Impl::StartExecuteAsync(AsyncContext &rCtx) { - aEndDlgHdl = rEndDialogHdl; - pDlg->StartExecuteAsync([=](sal_Int32 nResult){ - EndDialogHdl(nResult); - }); + // SwMailMergeWizardExecutor wants to run the lifecycle of this dialog + // so clear mxOwner here and leave it up to SwMailMergeWizardExecutor + rCtx.mxOwner.clear(); + return pDlg->StartExecuteAsync(rCtx); } -sal_Int32 AbstractMailMergeWizard_Impl::GetResult() +short AbstractMailMergeWizard_Impl::Execute() { - return pDlg->GetResult(); -} - -void AbstractMailMergeWizard_Impl::EndDialogHdl(sal_Int32 /*nResult*/) -{ - aEndDlgHdl.Call( *pDlg ); - aEndDlgHdl = Link<Dialog&,void>(); + return pDlg->Execute(); } OUString AbstractMailMergeWizard_Impl::GetReloadDocument() const diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index 8f2cf77a04c3..103b04b35a02 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -570,17 +570,15 @@ class SwMailMergeWizard; class AbstractMailMergeWizard_Impl : public AbstractMailMergeWizard { VclPtr<SwMailMergeWizard> pDlg; - Link<Dialog&,void> aEndDlgHdl; - void EndDialogHdl(sal_Int32 nResult); public: explicit AbstractMailMergeWizard_Impl( SwMailMergeWizard* p ) : pDlg(p) {} virtual ~AbstractMailMergeWizard_Impl() override; virtual void dispose() override; - virtual void StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl ) override; - virtual sal_Int32 GetResult() override; + virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) override; + virtual short Execute() override; virtual OUString GetReloadDocument() const override; virtual void ShowPage( sal_uInt16 nLevel ) override; diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx index 04255a9721c1..2b8520dc8a70 100644 --- a/sw/source/uibase/app/apphdl.cxx +++ b/sw/source/uibase/app/apphdl.cxx @@ -331,7 +331,7 @@ class SwMailMergeWizardExecutor : public salhelper::SimpleReferenceObject VclPtr<AbstractMailMergeWizard> m_pWizard; // always owner VclPtr<AbstractMailMergeWizard> m_pWizardToDestroyInCallback; - DECL_LINK( EndDialogHdl, Dialog&, void ); + void EndDialogHdl(sal_Int32 nResponse); DECL_LINK( DestroyDialogHdl, void*, void ); DECL_LINK( DestroyWizardHdl, void*, void ); DECL_LINK( CancelHdl, void*, void ); @@ -455,13 +455,13 @@ void SwMailMergeWizardExecutor::ExecutionFinished() void SwMailMergeWizardExecutor::ExecuteWizard() { - m_pWizard->StartExecuteModal( - LINK( this, SwMailMergeWizardExecutor, EndDialogHdl ) ); + m_pWizard->StartExecuteAsync([=](sal_Int32 nResult){ + EndDialogHdl(nResult); + }); } -IMPL_LINK_NOARG( SwMailMergeWizardExecutor, EndDialogHdl, Dialog&, void ) +void SwMailMergeWizardExecutor::EndDialogHdl(sal_Int32 nRet) { - long nRet = m_pWizard->GetResult(); sal_uInt16 nRestartPage = m_pWizard->GetRestartPage(); switch ( nRet ) |