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-18 14:34:21 +0100 |
commit | 848496394b6852a41948162cd530f36af90ae71f (patch) | |
tree | 7d003192c3a1d4f4f043beb984e926d372639e31 | |
parent | 2a43ffd305122c3397b23f49dfa378787e65f8a2 (diff) |
make insert->header/footer dialogs async
Reviewed-on: https://gerrit.libreoffice.org/66089
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
(cherry picked from commit 2281ade467e7dcc9652f74dbc4d9736100b0ad78)
Change-Id: I0e8eac86280d42752db2d7bde8c6aecf452bad6c
Reviewed-on: https://gerrit.libreoffice.org/66156
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Mert Tümer <mert.tumer@collabora.com>
Tested-by: Mert Tümer <mert.tumer@collabora.com>
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 24 | ||||
-rw-r--r-- | sc/source/ui/pagedlg/tphf.cxx | 14 |
2 files changed, 21 insertions, 17 deletions
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 22097e55c52c..839cf0257617 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -1810,22 +1810,26 @@ void ScDocShell::ExecutePageStyle( const SfxViewShell& rCaller, ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg( + VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg( GetActiveDialogParent(), rStyleSet, aStr, nResId)); - OSL_ENSURE(pDlg, "Dialog create fail!"); - 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 5a810ac498e3..a4a95e134990 100644 --- a/sc/source/ui/pagedlg/tphf.cxx +++ b/sc/source/ui/pagedlg/tphf.cxx @@ -189,14 +189,14 @@ IMPL_LINK_NOARG(ScHFPage, HFEditHdl, void*, void) ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg( + VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg( this, aDataSet, aStrPageStyle, nResId)); - - OSL_ENSURE(pDlg, "Dialog create fail!"); - 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 { |