diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-01-23 12:58:48 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-01-24 10:51:00 +0100 |
commit | a9ee88cc47783a809f6c49f5b7326180dc0bbead (patch) | |
tree | 1eac89c6e6434517c7d8611f2a9de6b17d7aac86 /sd/source/ui/func | |
parent | ad8248bcc7ed19285147aeff777771a508453a61 (diff) |
make text-table dialog async
Change-Id: Ic24b2b935f1d539cf257194d136d901b52e00a84
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162433
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui/func')
-rw-r--r-- | sd/source/ui/func/futxtatt.cxx | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/sd/source/ui/func/futxtatt.cxx b/sd/source/ui/func/futxtatt.cxx index 56f8c25696e0..9d9ce86fee67 100644 --- a/sd/source/ui/func/futxtatt.cxx +++ b/sd/source/ui/func/futxtatt.cxx @@ -51,28 +51,29 @@ void FuTextAttrDlg::DoExecute( SfxRequest& rReq ) const SfxItemSet* pArgs = rReq.GetArgs(); - if( !pArgs ) + if( pArgs ) { - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog(rReq.GetFrameWeld(), &aNewAttr, mpView)); + mpView->SetAttributes( *pArgs ); + return; + } - sal_uInt16 nResult = pDlg->Execute(); + SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); + VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog(rReq.GetFrameWeld(), &aNewAttr, mpView)); - switch( nResult ) + auto xRequest = std::make_shared<SfxRequest>(rReq); + rReq.Ignore(); // the 'old' request is not relevant any more + auto pView = mpView; // copy vars we need, FuTextAttrDlg object will be gone by the time the dialog completes + pDlg->StartExecuteAsync( + [pDlg, xRequest, pView] (sal_Int32 nResult)->void { - case RET_OK: + if (nResult == RET_OK) { - rReq.Done( *( pDlg->GetOutputItemSet() ) ); - - pArgs = rReq.GetArgs(); + xRequest->Done( *pDlg->GetOutputItemSet() ); + pView->SetAttributes( *xRequest->GetArgs() ); } - break; - - default: - return; // Cancel + pDlg->disposeOnce(); } - } - mpView->SetAttributes( *pArgs ); + ); } } // end of namespace sd |