sw/source/ui/dialog/swdlgfact.cxx   |    6 +++++-
 sw/source/ui/fldui/fldedt.cxx       |    6 ------
 sw/source/uibase/inc/fldedt.hxx     |    2 --
 sw/source/uibase/shells/textfld.cxx |   11 +++++++++--
 4 files changed, 14 insertions(+), 11 deletions(-)

New commits:
commit 1db2c88c5a9083680f37ac1656bf21ad049d1e98
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Jan 31 10:22:38 2024 +0200
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Fri Nov 22 08:05:36 2024 +0100

    make field-edit dialog async
    
    Change-Id: Ib24166fe0370a27357adf1611deafda2686a14aa
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162805
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    (cherry picked from commit 09c29b56fe8af1f3428a96017fec4d921e023906)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176949
    Tested-by: allotropia jenkins <jenk...@allotropia.de>
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>

diff --git a/sw/source/ui/dialog/swdlgfact.cxx 
b/sw/source/ui/dialog/swdlgfact.cxx
index 1d9b70a2a845..1517fce662df 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -1149,7 +1149,11 @@ VclPtr<AbstractSwFieldDlg> 
SwAbstractDialogFactory_Impl::CreateSwFieldDlg(SfxBin
 
 VclPtr<SfxAbstractDialog> 
SwAbstractDialogFactory_Impl::CreateSwFieldEditDlg(SwView& rVw)
 {
-    return 
VclPtr<SwAbstractSfxController_Impl>::Create(std::make_unique<SwFieldEditDlg>(rVw));
+    auto xDlg = std::make_shared<SwFieldEditDlg>(rVw);
+    // without TabPage no dialog
+    if (!xDlg->GetTabPage())
+        return nullptr;
+    return VclPtr<SwAbstractSfxController_Impl>::Create(std::move(xDlg));
 }
 
 VclPtr<AbstractSwRenameXNamedDlg> 
SwAbstractDialogFactory_Impl::CreateSwRenameXNamedDlg(weld::Widget* pParent,
diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx
index 306d864fab02..cec1f421ca4b 100644
--- a/sw/source/ui/fldui/fldedt.cxx
+++ b/sw/source/ui/fldui/fldedt.cxx
@@ -252,12 +252,6 @@ IMPL_LINK_NOARG(SwFieldEditDlg, OKHdl, weld::Button&, void)
     }
 }
 
-short SwFieldEditDlg::run()
-{
-    // without TabPage no dialog
-    return GetTabPage() ? SfxSingleTabDialogController::run() : 
static_cast<short>(RET_CANCEL);
-}
-
 // Traveling between fields of the same type
 IMPL_LINK(SwFieldEditDlg, NextPrevHdl, weld::Button&, rButton, void)
 {
diff --git a/sw/source/uibase/inc/fldedt.hxx b/sw/source/uibase/inc/fldedt.hxx
index 7692e1256137..635065580985 100644
--- a/sw/source/uibase/inc/fldedt.hxx
+++ b/sw/source/uibase/inc/fldedt.hxx
@@ -48,8 +48,6 @@ public:
 
     DECL_LINK(OKHdl, weld::Button&, void);
 
-    virtual short   run() override;
-
     void            EnableInsert(bool bEnable);
     void            InsertHdl();
 };
diff --git a/sw/source/uibase/shells/textfld.cxx 
b/sw/source/uibase/shells/textfld.cxx
index 9e1a50af4506..56042652b849 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -159,8 +159,15 @@ void SwTextShell::ExecField(SfxRequest &rReq)
                     default:
                     {
                         SwAbstractDialogFactory* pFact = 
SwAbstractDialogFactory::Create();
-                        ScopedVclPtr<SfxAbstractDialog> 
pDlg(pFact->CreateSwFieldEditDlg( GetView() ));
-                        pDlg->Execute();
+                        VclPtr<SfxAbstractDialog> 
pDlg(pFact->CreateSwFieldEditDlg( GetView() ));
+                        // without TabPage no dialog
+                        if (pDlg)
+                            pDlg->StartExecuteAsync(
+                                [pDlg] (sal_Int32 /*nResult*/)->void
+                                {
+                                    pDlg->disposeOnce();
+                                }
+                            );
                     }
                 }
             }

Reply via email to