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

make insert->header/footer dialogs async

Reviewed-on: https://gerrit.libreoffice.org/66089
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
(cherry picked from commit 2281ade4)

Change-Id: I0e8eac86280d42752db2d7bde8c6aecf452bad6c
Reviewed-on: https://gerrit.libreoffice.org/66156Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: 's avatarMert Tümer <mert.tumer@collabora.com>
Tested-by: 's avatarMert Tümer <mert.tumer@collabora.com>
üst 2a43ffd3
......@@ -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();
}
});
}
}
}
......
......@@ -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
{
......
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