include/svx/srchdlg.hxx | 2 + svx/source/dialog/srchdlg.cxx | 30 ++++++++++++++++++++--------- sw/source/ui/dialog/uiregionsw.cxx | 38 +++++++++++++++++++------------------ 3 files changed, 43 insertions(+), 27 deletions(-)
New commits: commit 5a5178cf05d18c787d86260600fd66ce14794f8e Author: Caolán McNamara <[email protected]> AuthorDate: Mon Jan 19 16:46:19 2026 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Mon Feb 23 22:22:16 2026 +0100 make search SimilarityDialog async Change-Id: Ib8a704f929d557b7ceb45762fbcfe452346ea727 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197599 Reviewed-by: Miklos Vajna <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199319 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Caolán McNamara <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200089 diff --git a/include/svx/srchdlg.hxx b/include/svx/srchdlg.hxx index d35bd5b98cf2..cf93f50299c4 100644 --- a/include/svx/srchdlg.hxx +++ b/include/svx/srchdlg.hxx @@ -275,6 +275,8 @@ private: SVX_DLLPRIVATE bool IsOtherOptionsExpanded() const; SVX_DLLPRIVATE short executeSubDialog(VclAbstractDialog * dialog); + SVX_DLLPRIVATE void executeSubDialog(VclPtr<VclAbstractDialog> dialog, + const std::function<void(sal_Int32)>& func); DECL_DLLPRIVATE_LINK(PresentTimeoutHdl_Impl, Timer*, void); }; diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index f7d5599c4488..8a04cb940dcb 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -1415,17 +1415,18 @@ IMPL_LINK(SvxSearchDialog, CommandHdl_Impl, weld::Button&, rBtn, void) else if (&rBtn == m_xSimilarityBtn.get()) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractSvxSearchSimilarityDialog> pDlg(pFact->CreateSvxSearchSimilarityDialog( + VclPtr<AbstractSvxSearchSimilarityDialog> pDlg(pFact->CreateSvxSearchSimilarityDialog( m_xDialog.get(), m_pSearchItem->IsLEVRelaxed(), m_pSearchItem->GetLEVOther(), m_pSearchItem->GetLEVShorter(), m_pSearchItem->GetLEVLonger())); - if ( executeSubDialog(pDlg.get()) == RET_OK ) - { - m_pSearchItem->SetLEVRelaxed(pDlg->IsRelaxed()); - m_pSearchItem->SetLEVOther(pDlg->GetOther()); - m_pSearchItem->SetLEVShorter(pDlg->GetShorter()); - m_pSearchItem->SetLEVLonger(pDlg->GetLonger()); - SaveToModule_Impl(); - } + executeSubDialog(pDlg, [pDlg, this](sal_Int32 nResult) { + if (nResult == RET_OK ) { + m_pSearchItem->SetLEVRelaxed(pDlg->IsRelaxed()); + m_pSearchItem->SetLEVOther(pDlg->GetOther()); + m_pSearchItem->SetLEVShorter(pDlg->GetShorter()); + m_pSearchItem->SetLEVLonger(pDlg->GetLonger()); + SaveToModule_Impl(); + }; + }); } else if (&rBtn == m_xJapOptionsBtn.get()) { @@ -2354,6 +2355,17 @@ short SvxSearchDialog::executeSubDialog(VclAbstractDialog * dialog) { return dialog->Execute(); } +void SvxSearchDialog::executeSubDialog(VclPtr<VclAbstractDialog> dialog, const std::function<void(sal_Int32)>& func) { + assert(!m_executingSubDialog); + m_executingSubDialog = true; + + dialog->StartExecuteAsync([dialog, func, this](sal_Int32 nResult) { + func(nResult); + dialog->disposeOnce(); + m_executingSubDialog = false; + }); +} + SFX_IMPL_CHILDWINDOW_WITHID(SvxSearchDialogWrapper, SID_SEARCH_DLG); commit b12344c7de9535882a58e284962b54e1f7584440 Author: Caolán McNamara <[email protected]> AuthorDate: Mon Jan 19 11:34:56 2026 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Mon Feb 23 22:22:09 2026 +0100 make writer section password dialog async Change-Id: Icc65d0e68a2de01b7d34f0ee2768c8c510ebf1d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197578 Reviewed-by: Caolán McNamara <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> Tested-by: Caolán McNamara <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200088 diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index b0a8e0e666cc..299ddd6fd34b 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -1661,25 +1661,27 @@ void SwInsertSectionTabPage::ChangePasswd(bool bChange) { if(!m_aNewPasswd.hasElements() || bChange) { - SfxPasswordDialog aPasswdDlg(GetFrameWeld()); - aPasswdDlg.ShowExtras(SfxShowExtras::CONFIRM); - if (RET_OK == aPasswdDlg.run()) - { - const OUString sNewPasswd(aPasswdDlg.GetPassword()); - if (aPasswdDlg.GetConfirm() == sNewPasswd) - { - SvPasswordHelper::GetHashPassword( m_aNewPasswd, sNewPasswd ); - } - else - { - std::shared_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(), - VclMessageType::Info, VclButtonsType::Ok, - SwResId(STR_WRONG_PASSWD_REPEAT))); - xInfoBox->runAsync(xInfoBox, [](sal_uInt32) {}); + auto xPasswdDlg = std::make_shared<SfxPasswordDialog>(GetFrameWeld()); + xPasswdDlg->ShowExtras(SfxShowExtras::CONFIRM); + xPasswdDlg->PreRun(); + weld::GenericDialogController::runAsync(xPasswdDlg, [xPasswdDlg, this, bChange](sal_Int32 nResult){ + if (nResult == RET_OK) { + const OUString sNewPasswd(xPasswdDlg->GetPassword()); + if (xPasswdDlg->GetConfirm() == sNewPasswd) + { + SvPasswordHelper::GetHashPassword( m_aNewPasswd, sNewPasswd ); + } + else + { + std::shared_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Info, VclButtonsType::Ok, + SwResId(STR_WRONG_PASSWD_REPEAT))); + xInfoBox->runAsync(xInfoBox, [](sal_uInt32) {}); + } } - } - else if(!bChange) - m_xPasswdCB->set_active(false); + else if(!bChange) + m_xPasswdCB->set_active(false); + }); } } else
