diff options
author | Henry Castro <hcastro@collabora.com> | 2020-12-04 17:34:48 -0400 |
---|---|---|
committer | Henry Castro <hcastro@collabora.com> | 2021-01-18 22:06:56 +0100 |
commit | 3557bb2a5cb2119dba7d84bdd723c5887e64c2d0 (patch) | |
tree | 3b21c87ae445e7120f50cf6330ba61a8cc1f375c /sfx2 | |
parent | 668fe5ba93a80f3949d0747917f74292a2606215 (diff) |
lok: run async the Macro Selector Dialog
Required to be called by the client side
Change-Id: I9c9d22dd249839009bdc6a701553f3b9d776347a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107246
Tested-by: Jenkins
Reviewed-by: Henry Castro <hcastro@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109137
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 0633c12df3e7..07f56777b5af 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -1535,32 +1535,37 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) do // artificial loop for flow control { - ScopedVclPtr<AbstractScriptSelectorDialog> pDlg(pFact->CreateScriptSelectorDialog(lcl_getDialogParent(xFrame), xFrame)); + VclPtr<AbstractScriptSelectorDialog> pDlg(pFact->CreateScriptSelectorDialog(lcl_getDialogParent(xFrame), xFrame)); OSL_ENSURE( pDlg, "SfxApplication::OfaExec_Impl( SID_RUNMACRO ): no dialog!" ); if ( !pDlg ) break; pDlg->SetRunLabel(); - short nDialogResult = pDlg->Execute(); - if ( !nDialogResult ) - break; + pDlg->StartExecuteAsync([pDlg, xFrame](sal_Int32 nDialogResult) { + if ( !nDialogResult ) + { + pDlg->disposeOnce(); + return; + } - Sequence< Any > args; - Sequence< sal_Int16 > outIndex; - Sequence< Any > outArgs; - Any ret; + Sequence< Any > args; + Sequence< sal_Int16 > outIndex; + Sequence< Any > outArgs; + Any ret; - Reference< XInterface > xScriptContext; + Reference< XInterface > xScriptContext; - Reference< XController > xController; - if ( xFrame.is() ) - xController = xFrame->getController(); - if ( xController.is() ) - xScriptContext = xController->getModel(); - if ( !xScriptContext.is() ) - xScriptContext = xController; + Reference< XController > xController; + if ( xFrame.is() ) + xController = xFrame->getController(); + if ( xController.is() ) + xScriptContext = xController->getModel(); + if ( !xScriptContext.is() ) + xScriptContext = xController; - SfxObjectShell::CallXScript( xScriptContext, pDlg->GetScriptURL(), args, ret, outIndex, outArgs ); + SfxObjectShell::CallXScript( xScriptContext, pDlg->GetScriptURL(), args, ret, outIndex, outArgs ); + pDlg->disposeOnce(); + }); } while ( false ); rReq.Done(); |