Kaydet (Commit) 2281ade4 authored tarafından Noel Grandin's avatar Noel Grandin

make insert->header/footer dialogs async

Change-Id: I0e8eac86280d42752db2d7bde8c6aecf452bad6c
Reviewed-on: https://gerrit.libreoffice.org/66089
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 09f9b5f6
...@@ -1850,21 +1850,26 @@ void ScDocShell::ExecutePageStyle( const SfxViewShell& rCaller, ...@@ -1850,21 +1850,26 @@ void ScDocShell::ExecutePageStyle( const SfxViewShell& rCaller,
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg( VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg(
GetActiveDialogParent(), GetActiveDialogParent(),
rStyleSet, rStyleSet,
aStr, aStr,
nResId)); nResId));
if ( pDlg->Execute() == RET_OK ) std::shared_ptr<SfxRequest> xRequest(new SfxRequest(rReq));
{ rReq.Ignore(); // the 'old' request is not relevant any more
const SfxItemSet* pOutSet = pDlg->GetOutputItemSet(); pDlg->StartExecuteAsync([this, pDlg, pStyleSheet, xRequest](sal_Int32 nResult){
if ( nResult == RET_OK )
{
const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
if ( pOutSet ) if ( pOutSet )
m_aDocument.ModifyStyleSheet( *pStyleSheet, *pOutSet ); m_aDocument.ModifyStyleSheet( *pStyleSheet, *pOutSet );
SetDocumentModified(); SetDocumentModified();
rReq.Done(); xRequest->Done();
} pDlg->disposeOnce();
}
});
} }
} }
} }
......
...@@ -182,13 +182,14 @@ IMPL_LINK_NOARG(ScHFPage, HFEditHdl, void*, void) ...@@ -182,13 +182,14 @@ IMPL_LINK_NOARG(ScHFPage, HFEditHdl, void*, void)
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg( VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg(
this, aDataSet, aStrPageStyle, nResId)); this, aDataSet, aStrPageStyle, nResId));
pDlg->StartExecuteAsync([this, pDlg](sal_Int32 nResult){
if ( pDlg->Execute() == RET_OK ) if ( nResult == RET_OK )
{ {
aDataSet.Put( *pDlg->GetOutputItemSet() ); aDataSet.Put( *pDlg->GetOutputItemSet() );
} }
});
} }
else else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment