sw/source/uibase/uiview/view2.cxx |   16 ++++++++++++----
 vcl/jsdialog/enabled.cxx          |    1 +
 2 files changed, 13 insertions(+), 4 deletions(-)

New commits:
commit 8b60950947e8017b1f0b30538b6ef9a3bab51bee
Author:     Hubert Figuière <h...@collabora.com>
AuthorDate: Thu Jul 10 17:45:48 2025 -0400
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Mon Jul 14 08:36:19 2025 +0200

    writer: Make GotoPage dialog async
    
    Enable it in JSDialog
    
    Signed-off-by: Hubert Figuière <h...@collabora.com>
    Change-Id: I1fe8217f1c6ba38bd46482f40543965f21d0f638
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187669
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>
    (cherry picked from commit ec2800c1e1b30a0096f4ceaadb9cb875dcb3977f)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187733
    Tested-by: Jenkins

diff --git a/sw/source/uibase/uiview/view2.cxx 
b/sw/source/uibase/uiview/view2.cxx
index fbfe7a6e9d25..44ccd1f9d4d7 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -1307,10 +1307,18 @@ void SwView::Execute(SfxRequest &rReq)
             sal_uInt16 nPhyPage, nVirPage;
             GetWrtShell().GetPageNum(nPhyPage, nVirPage);
 
-            svx::GotoPageDlg aDlg(GetViewFrame().GetFrameWeld(), 
SwResId(STR_GOTO_PAGE_DLG_TITLE),
-                                 SwResId(ST_PGE) + ":", nPhyPage, 
GetWrtShell().GetPageCnt());
-            if (aDlg.run() == RET_OK)
-                GetWrtShell().GotoPage(aDlg.GetPageSelection(), true);
+            std::shared_ptr<SfxRequest> xRequest = 
std::make_shared<SfxRequest>(rReq);
+            rReq.Ignore();
+
+            auto xDialog = std::make_shared<svx::GotoPageDlg>(
+                GetViewFrame().GetFrameWeld(), 
SwResId(STR_GOTO_PAGE_DLG_TITLE),
+                SwResId(ST_PGE) + ":", nPhyPage, GetWrtShell().GetPageCnt());
+            weld::DialogController::runAsync(xDialog, [this, xDialog, 
xRequest](sal_uInt32 nResult) {
+                if (nResult == RET_OK)
+                    GetWrtShell().GotoPage(xDialog->GetPageSelection(), true);
+
+                xRequest->Done();
+            });
         }
         break;
         case  FN_EDIT_CURRENT_TOX:
diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx
index 14b183bcd3ac..4a21a7d05478 100644
--- a/vcl/jsdialog/enabled.cxx
+++ b/vcl/jsdialog/enabled.cxx
@@ -316,6 +316,7 @@ constexpr auto OtherDialogList
         { u"svx/ui/compressgraphicdialog.ui" },
         { u"svx/ui/findreplacedialog.ui" },
         { u"svx/ui/fontworkgallerydialog.ui" },
+        { u"svx/ui/gotopagedialog.ui" },
         { u"svx/ui/headfootformatpage.ui" },
         { u"svx/ui/redlinecontrol.ui" },
         { u"svx/ui/redlinefilterpage.ui" },

Reply via email to