diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-01-22 14:12:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-01-22 19:48:35 +0100 |
commit | dde1868544bf325a359bdf4336623ac65e6ff4e0 (patch) | |
tree | bc42937af42ef1b1ef09196b1dee904188e8325f /sc/source/ui/drawfunc | |
parent | 6a5ef1a2b009f208745a251828bf8e8c51146bfe (diff) |
object-title dialog can be used async
Change-Id: Ia5869788ccefcd17ef561bafb41da6f0d48fd54d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162394
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/drawfunc')
-rw-r--r-- | sc/source/ui/drawfunc/drawsh5.cxx | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx index 679d8a841a66..2c0a1cf1f66d 100644 --- a/sc/source/ui/drawfunc/drawsh5.cxx +++ b/sc/source/ui/drawfunc/drawsh5.cxx @@ -582,22 +582,28 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); vcl::Window* pWin = rViewData.GetActiveWin(); - ScopedVclPtr<AbstractSvxObjectTitleDescDialog> pDlg(pFact->CreateSvxObjectTitleDescDialog( + VclPtr<AbstractSvxObjectTitleDescDialog> pDlg(pFact->CreateSvxObjectTitleDescDialog( pWin ? pWin->GetFrameWeld() : nullptr, aTitle, aDescription, isDecorative)); - if(RET_OK == pDlg->Execute()) - { - ScDocShell* pDocSh = rViewData.GetDocShell(); + pDlg->StartExecuteAsync( + [this, pDlg, pSelected] (sal_Int32 nResult)->void + { + if (nResult == RET_OK) + { + ScDocShell* pDocSh = rViewData.GetDocShell(); - // handle Title and Description - pSelected->SetTitle(pDlg->GetTitle()); - pSelected->SetDescription(pDlg->GetDescription()); - pSelected->SetDecorative(pDlg->IsDecorative()); + // handle Title and Description + pSelected->SetTitle(pDlg->GetTitle()); + pSelected->SetDescription(pDlg->GetDescription()); + pSelected->SetDecorative(pDlg->IsDecorative()); - // ChartListenerCollectionNeedsUpdate is needed for Navigator update - pDocSh->GetDocument().SetChartListenerCollectionNeedsUpdate( true ); - pDocSh->SetDrawModified(); - } + // ChartListenerCollectionNeedsUpdate is needed for Navigator update + pDocSh->GetDocument().SetChartListenerCollectionNeedsUpdate( true ); + pDocSh->SetDrawModified(); + } + pDlg->disposeOnce(); + } + ); } } break; |