diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-10 14:31:21 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-11 09:44:34 +0100 |
commit | 2281ade467e7dcc9652f74dbc4d9736100b0ad78 (patch) | |
tree | 69b0d08b44de312455d6adf34c378324494564b0 /sc | |
parent | 09f9b5f6ba9e4590227b12eb8232a56d003086ea (diff) |
make insert->header/footer dialogs async
Change-Id: I0e8eac86280d42752db2d7bde8c6aecf452bad6c
Reviewed-on: https://gerrit.libreoffice.org/66089
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 23 | ||||
-rw-r--r-- | sc/source/ui/pagedlg/tphf.cxx | 13 |
2 files changed, 21 insertions, 15 deletions
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 66a7048fd3b0..11f240c9d2f8 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -1850,21 +1850,26 @@ void ScDocShell::ExecutePageStyle( const SfxViewShell& rCaller, ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); - ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg( + VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg( GetActiveDialogParent(), rStyleSet, aStr, nResId)); - if ( pDlg->Execute() == RET_OK ) - { - const SfxItemSet* pOutSet = pDlg->GetOutputItemSet(); + std::shared_ptr<SfxRequest> xRequest(new SfxRequest(rReq)); + rReq.Ignore(); // the 'old' request is not relevant any more + pDlg->StartExecuteAsync([this, pDlg, pStyleSheet, xRequest](sal_Int32 nResult){ + if ( nResult == RET_OK ) + { + const SfxItemSet* pOutSet = pDlg->GetOutputItemSet(); - if ( pOutSet ) - m_aDocument.ModifyStyleSheet( *pStyleSheet, *pOutSet ); + if ( pOutSet ) + m_aDocument.ModifyStyleSheet( *pStyleSheet, *pOutSet ); - SetDocumentModified(); - rReq.Done(); - } + SetDocumentModified(); + xRequest->Done(); + pDlg->disposeOnce(); + } + }); } } } diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx index 8cc1f28a327c..d7ca87aec728 100644 --- a/sc/source/ui/pagedlg/tphf.cxx +++ b/sc/source/ui/pagedlg/tphf.cxx @@ -182,13 +182,14 @@ IMPL_LINK_NOARG(ScHFPage, HFEditHdl, void*, void) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); - ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg( + VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg( this, aDataSet, aStrPageStyle, nResId)); - - if ( pDlg->Execute() == RET_OK ) - { - aDataSet.Put( *pDlg->GetOutputItemSet() ); - } + pDlg->StartExecuteAsync([this, pDlg](sal_Int32 nResult){ + if ( nResult == RET_OK ) + { + aDataSet.Put( *pDlg->GetOutputItemSet() ); + } + }); } else { |