sw/source/uibase/uiview/view2.cxx | 16 ++++++++++++---- vcl/jsdialog/enabled.cxx | 1 + 2 files changed, 13 insertions(+), 4 deletions(-)
New commits: commit ec2800c1e1b30a0096f4ceaadb9cb875dcb3977f Author: Hubert Figuière <[email protected]> AuthorDate: Thu Jul 10 17:45:48 2025 -0400 Commit: Miklos Vajna <[email protected]> CommitDate: Fri Jul 11 15:26:27 2025 +0200 writer: Make GotoPage dialog async Enable it in JSDialog Signed-off-by: Hubert Figuière <[email protected]> Change-Id: I1fe8217f1c6ba38bd46482f40543965f21d0f638 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187669 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index c483c4a789f2..a6b9493992c2 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -1302,10 +1302,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 11e2e6b6c171..a5b1fa38f334 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -321,6 +321,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" },
