sw/source/ui/dialog/swdlgfact.cxx   |    8 +++++++-
 sw/source/ui/dialog/swdlgfact.hxx   |    5 +++--
 sw/source/uibase/shells/textsh1.cxx |   14 ++++++++++----
 sw/source/uibase/uiview/view0.cxx   |    9 +++++++--
 4 files changed, 27 insertions(+), 9 deletions(-)

New commits:
commit 84572ef8c27fc4d4a7720303972f877ed2db8f79
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Tue Jan 30 16:14:08 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue Jan 30 20:13:17 2024 +0100

    make redline-accept dialog async
    
    Change-Id: Ib0cd3145b1f2d12926c1c17335551f0ba576bd7d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162763
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/ui/dialog/swdlgfact.cxx 
b/sw/source/ui/dialog/swdlgfact.cxx
index 46825f29a320..a0f7ec33225f 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -283,7 +283,13 @@ short AbstractSwContentControlListItemDlg_Impl::Execute()
 
 short AbstractSwModalRedlineAcceptDlg_Impl::Execute()
 {
-    return m_xDlg->run();
+    assert(false);
+    return -1;
+}
+
+bool 
AbstractSwModalRedlineAcceptDlg_Impl::StartExecuteAsync(VclAbstractDialog::AsyncContext&
 rCtx)
+{
+    return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn);
 }
 
 short AbstractGlossaryDlg_Impl::Execute()
diff --git a/sw/source/ui/dialog/swdlgfact.hxx 
b/sw/source/ui/dialog/swdlgfact.hxx
index 88e9d2b632c7..9e04a8b70db3 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -509,13 +509,14 @@ public:
 
 class AbstractSwModalRedlineAcceptDlg_Impl : public 
AbstractSwModalRedlineAcceptDlg
 {
-    std::unique_ptr<SwModalRedlineAcceptDlg> m_xDlg;
+    std::shared_ptr<SwModalRedlineAcceptDlg> m_xDlg;
 public:
-    explicit 
AbstractSwModalRedlineAcceptDlg_Impl(std::unique_ptr<SwModalRedlineAcceptDlg> p)
+    explicit 
AbstractSwModalRedlineAcceptDlg_Impl(std::shared_ptr<SwModalRedlineAcceptDlg> p)
         : m_xDlg(std::move(p))
     {
     }
     virtual short Execute() override;
+    virtual bool StartExecuteAsync(VclAbstractDialog::AsyncContext &) override;
 };
 
 class SwGlossaryDlg;
diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index 1a70f027fdef..a1680e5be43a 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1253,10 +1253,16 @@ void SwTextShell::Execute(SfxRequest &rReq)
                 rVFrame.ToggleChildWindow(FN_REDLINE_ACCEPT);
 
             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-            ScopedVclPtr<AbstractSwModalRedlineAcceptDlg> 
xDlg(pFact->CreateSwModalRedlineAcceptDlg(GetView().GetEditWin().GetFrameWeld()));
-
-            xDlg->Execute();
-            rReq.Done();
+            auto xRequest = std::make_shared<SfxRequest>(rReq);
+            rReq.Ignore(); // the 'old' request is not relevant any more
+            VclPtr<AbstractSwModalRedlineAcceptDlg> 
pDlg(pFact->CreateSwModalRedlineAcceptDlg(GetView().GetEditWin().GetFrameWeld()));
+            pDlg->StartExecuteAsync(
+                [pDlg, xRequest] (sal_Int32 /*nResult*/)->void
+                {
+                    pDlg->disposeOnce();
+                    xRequest->Done();
+                }
+            );
         }
         break;
 
commit 9f5dd47de9c0dc9e95980fa08b4358aa9228c5c0
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Tue Jan 30 16:10:17 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue Jan 30 20:13:07 2024 +0100

    make outline-tab dialog async
    
    Change-Id: Ie4fd5e9893af6687230bc2a02d4459a1140d0e6f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162762
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/uibase/uiview/view0.cxx 
b/sw/source/uibase/uiview/view0.cxx
index 4e9b743b6cd6..2a27bd95b5a9 100644
--- a/sw/source/uibase/uiview/view0.cxx
+++ b/sw/source/uibase/uiview/view0.cxx
@@ -752,8 +752,13 @@ void SwView::ExecNumberingOutline(SfxItemPool & rPool)
 {
     SfxItemSetFixed<FN_PARAM_1, FN_PARAM_1> aTmp(rPool);
     SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-    ScopedVclPtr<SfxAbstractTabDialog> 
pDlg(pFact->CreateOutlineTabDialog(GetFrameWeld(), &aTmp, GetWrtShell()));
-    pDlg->Execute();
+    VclPtr<SfxAbstractTabDialog> 
pDlg(pFact->CreateOutlineTabDialog(GetFrameWeld(), &aTmp, GetWrtShell()));
+    pDlg->StartExecuteAsync(
+        [pDlg] (sal_Int32 /*nResult*/)->void
+        {
+            pDlg->disposeOnce();
+        }
+    );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to