sc/source/ui/attrdlg/scdlgfact.cxx | 2 +- sc/source/ui/view/cellsh1.cxx | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-)
New commits: commit f1826dc8c35eb099fd34b640f8435308b4944ae3 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 16:03: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/+/200181 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index d2fa109d8266..262d883aee0e 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -277,7 +277,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 a68b541b5d77..18a8e3f8acc8 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -510,16 +510,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());
