diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-01-31 13:10:52 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-02-01 07:00:04 +0100 |
commit | 137df7cd67e5bb34cb75f716700d3c765a3efad2 (patch) | |
tree | 503ed29dbe1f1caef4af145c99693c416c5f60ba /sw/source/uibase/dbui | |
parent | 1276daee3d0d4f30ee8844b6df55d72e0b54093f (diff) |
make insert-db-col-auto-pilot dialog async
Change-Id: I954c9a4c55c9c641955484626aa744dd9fa74995
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162808
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase/dbui')
-rw-r--r-- | sw/source/uibase/dbui/dbmgr.cxx | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index bb4cdc12cdbe..7c97db631403 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -3070,24 +3070,32 @@ void SwDBManager::InsertText(SwWrtShell& rSh, aDBData.nCommandType = nCmdType; SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractSwInsertDBColAutoPilot> pDlg(pFact->CreateSwInsertDBColAutoPilot( rSh.GetView(), + VclPtr<AbstractSwInsertDBColAutoPilot> pDlg(pFact->CreateSwInsertDBColAutoPilot( rSh.GetView(), xSource, xColSupp, aDBData )); - if( RET_OK != pDlg->Execute() ) - return; + pDlg->StartExecuteAsync( + [xConnection, xSource, pDlg, xResSet, aSelection] (sal_Int32 nResult)->void + { + if (nResult == RET_OK) + { + OUString sDummy; + auto xTmpConnection = xConnection; + if(!xTmpConnection.is()) + xTmpConnection = xSource->getConnection(sDummy, sDummy); + try + { + pDlg->DataToDoc( aSelection , xSource, xTmpConnection, xResSet); + } + catch (const uno::Exception&) + { + TOOLS_WARN_EXCEPTION("sw.mailmerge", ""); + } + pDlg->disposeOnce(); + } + } + ); - OUString sDummy; - if(!xConnection.is()) - xConnection = xSource->getConnection(sDummy, sDummy); - try - { - pDlg->DataToDoc( aSelection , xSource, xConnection, xResSet); - } - catch (const uno::Exception&) - { - TOOLS_WARN_EXCEPTION("sw.mailmerge", ""); - } } uno::Reference<sdbc::XDataSource> SwDBManager::getDataSourceAsParent(const uno::Reference< sdbc::XConnection>& _xConnection,const OUString& _sDataSourceName) |