sw/source/ui/dialog/uiregionsw.cxx | 38 +++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-)
New commits: commit f30c893c9e2b56cd90a106a214a477179ce4c4d2 Author: Caolán McNamara <[email protected]> AuthorDate: Mon Jan 19 11:34:56 2026 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Thu Feb 12 12:27:51 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/+/199262 Tested-by: Jenkins diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index ce3ec6df9519..5c3770d4ee09 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
