sc/source/ui/attrdlg/scdlgfact.cxx |    5 +++++
 sc/source/ui/attrdlg/scdlgfact.hxx |    3 ++-
 sc/source/ui/view/cellsh1.cxx      |   19 +++++++++++++------
 3 files changed, 20 insertions(+), 7 deletions(-)

New commits:
commit 09d0923f5e75670c68cf1a86a97e76bc7c766c12
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Feb 9 11:58:05 2026 +0000
Commit:     Miklos Vajna <[email protected]>
CommitDate: Tue Feb 10 11:16:46 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]>

diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx 
b/sc/source/ui/attrdlg/scdlgfact.cxx
index c088322f01a2..550121729521 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -169,6 +169,11 @@ short AbstractScDeleteContentsDlg_Impl::Execute()
     return m_xDlg->run();
 }
 
+bool 
AbstractScDeleteContentsDlg_Impl::StartExecuteAsync(VclAbstractDialog::AsyncContext
 &rCtx)
+{
+    return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn);
+}
+
 short AbstractScFillSeriesDlg_Impl::Execute()
 {
     return m_xDlg->run();
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx 
b/sc/source/ui/attrdlg/scdlgfact.hxx
index fe60d59bc8e6..ec629369dd23 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -208,13 +208,14 @@ public:
 
 class AbstractScDeleteContentsDlg_Impl : public AbstractScDeleteContentsDlg
 {
-    std::unique_ptr<ScDeleteContentsDlg> m_xDlg;
+    std::shared_ptr<ScDeleteContentsDlg> m_xDlg;
 public:
     explicit 
AbstractScDeleteContentsDlg_Impl(std::unique_ptr<ScDeleteContentsDlg> p)
         : m_xDlg(std::move(p))
     {
     }
     virtual short   Execute() override;
+    virtual bool    StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) 
override;
     virtual void    DisableObjects() override;
     virtual InsertDeleteFlags GetDelContentsCmdBits() const override;
 
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 6982aa907313..567b5c593a2f 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -506,16 +506,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());

Reply via email to