summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-01-10 14:31:21 +0200
committerAndras Timar <andras.timar@collabora.com>2019-09-19 21:06:15 +0200
commitc6af5af11d889dc0feee35c9daf9909249f5a6d9 (patch)
tree1de5bd02a288ab2a69777a2634aa0d986181f6e6
parentcd1dec8142280ba3977321c86cabaee45fd585ca (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> (cherry picked from commit 2281ade467e7dcc9652f74dbc4d9736100b0ad78) Reviewed-on: https://gerrit.libreoffice.org/79127 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--sc/source/ui/docshell/docsh4.cxx23
-rw-r--r--sc/source/ui/pagedlg/tphf.cxx13
2 files changed, 21 insertions, 15 deletions
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 319481947672..d30202cf10c8 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1860,21 +1860,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
{