sc/source/ui/attrdlg/scdlgfact.cxx | 2 +- sc/source/ui/view/cellsh1.cxx | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-)
New commits: commit 9c60d11620bca485c879a20c0cbfbf4d5ad14598 Author: Caolán McNamara <[email protected]> AuthorDate: Mon Feb 9 11:58:05 2026 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Tue Feb 24 13:43:50 2026 +0100 make DeleteContents dialog async Change-Id: I273440aa87e794ea136a81bf4c4b0d7a5f8dac57 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198978 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200168 Reviewed-by: Caolán McNamara <[email protected]> diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index 67ee17a4da49..d44dbee0c8f2 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -297,7 +297,7 @@ VclPtr<AbstractScDataFormDlg> ScAbstractDialogFactory_Impl::CreateScDataFormDlg( namespace { class AbstractScDeleteContentsDlg_Impl - : public ScreenshottedDialog_Impl_Sync<AbstractScDeleteContentsDlg, ScDeleteContentsDlg> + : public ScreenshottedDialog_Impl_Async<AbstractScDeleteContentsDlg, ScDeleteContentsDlg> { public: using ScreenshottedDialog_Impl_BASE::ScreenshottedDialog_Impl_BASE; diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index f92b82958742..c0bc2200bcbc 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -507,16 +507,23 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) { ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractScDeleteContentsDlg> pDlg(pFact->CreateScDeleteContentsDlg(pTabViewShell->GetFrameWeld())); + VclPtr<AbstractScDeleteContentsDlg> pDlg(pFact->CreateScDeleteContentsDlg(pTabViewShell->GetFrameWeld())); ScDocument& rDoc = GetViewData().GetDocument(); SCTAB nTab = GetViewData().CurrentTabForData(); if ( rDoc.IsTabProtected(nTab) ) pDlg->DisableObjects(); - if (pDlg->Execute() == RET_OK) - { - InsertDeleteFlags nFlags = pDlg->GetDelContentsCmdBits(); - DeleteContents(pTabViewShell, rReq, nFlags); - } + + auto xRequest = std::make_shared<SfxRequest>(rReq); + rReq.Ignore(); // the 'old' request is not relevant any more + + pDlg->StartExecuteAsync([pDlg, pTabViewShell, xRequest=std::move(xRequest)](sal_Int32 nResult){ + if (nResult == RET_OK) + { + InsertDeleteFlags nFlags = pDlg->GetDelContentsCmdBits(); + DeleteContents(pTabViewShell, *xRequest, nFlags); + } + pDlg->disposeOnce(); + }); } else pTabViewShell->ErrorMessage(aTester.GetMessageId());
