diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index 6d280ebd0a82..159e0290fc4e 100644 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -531,6 +531,19 @@ executePasswordDialog( } else // enter password or reenter password { + if (nMode == task::PasswordRequestMode_PASSWORD_REENTER) + { + TranslateId pOpenToModifyErrStrId = bIsPasswordToModify + ? STR_ERROR_PASSWORD_TO_MODIFY_WRONG + : STR_ERROR_PASSWORD_TO_OPEN_WRONG; + TranslateId pErrStrId = bIsSimplePasswordRequest ? STR_ERROR_SIMPLE_PASSWORD_WRONG + : pOpenToModifyErrStrId; + OUString aErrorMsg(Translate::get(pErrStrId, aResLocale)); + std::unique_ptr xBox(Application::CreateMessageDialog( + pParent, VclMessageType::Warning, VclButtonsType::Ok, aErrorMsg)); + xBox->run(); + } + std::unique_ptr xDialog(new PasswordDialog(pParent, nMode, aResLocale, aDocName, bIsPasswordToModify, bIsSimplePasswordRequest)); xDialog->SetMinLen(0); diff --git a/uui/source/passworddlg.cxx b/uui/source/passworddlg.cxx index 382c387bc6b3..f027746a6994 100644 --- a/uui/source/passworddlg.cxx +++ b/uui/source/passworddlg.cxx @@ -45,16 +45,6 @@ PasswordDialog::PasswordDialog(weld::Window* pParent, // tdf#115964 we can be launched before the parent has resized to its final size m_xDialog->set_centered_on_parent(true); - if( nDialogMode == task::PasswordRequestMode_PASSWORD_REENTER ) - { - TranslateId pOpenToModifyErrStrId = bOpenToModify ? STR_ERROR_PASSWORD_TO_MODIFY_WRONG : STR_ERROR_PASSWORD_TO_OPEN_WRONG; - TranslateId pErrStrId = bIsSimplePasswordRequest ? STR_ERROR_SIMPLE_PASSWORD_WRONG : pOpenToModifyErrStrId; - OUString aErrorMsg(Translate::get(pErrStrId, rResLocale)); - std::unique_ptr xBox(Application::CreateMessageDialog(pParent, - VclMessageType::Warning, VclButtonsType::Ok, aErrorMsg)); - xBox->run(); - } - m_xPass[0] = m_xBuilder->weld_toggle_button(u"togglebt1"_ustr); m_xPass[1] = m_xBuilder->weld_toggle_button(u"togglebt2"_ustr);