summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNickWingate <nick.wingate@collabora.com>2022-12-28 17:27:31 +0000
committerAndras Timar <andras.timar@collabora.com>2023-01-19 12:48:06 +0000
commit7ebe5e19fb379c88b8e455693a23fd9036c1b517 (patch)
treede08a8c75f8252060c7a85403f2d98a30f7b86b3 /sfx2
parentee8aa3dbaf6c02c9ea1bd7781e5e71847b4e614b (diff)
Make PDFExport Password Subdialog Async
Dialog in File>Export As PDF>Security>Set Password Close subdialog when parent dialog is closed Signed-off-by: NickWingate <nick.wingate@collabora.com> Change-Id: I9db8459309f2806ed47f9f932e0bde246400b2dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144854 Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145759 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/passwd.cxx30
1 files changed, 23 insertions, 7 deletions
diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx
index 13822c4a94d4..51f3abd84c0c 100644
--- a/sfx2/source/dialog/passwd.cxx
+++ b/sfx2/source/dialog/passwd.cxx
@@ -74,12 +74,18 @@ IMPL_LINK_NOARG(SfxPasswordDialog, OKHdl, weld::Button&, void)
bConfirmFailed = true;
if ( bConfirmFailed )
{
- std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(),
- VclMessageType::Warning, VclButtonsType::Ok,
- SfxResId(STR_ERROR_WRONG_CONFIRM)));
- xBox->run();
- m_xConfirm1ED->set_text(OUString());
- m_xConfirm1ED->grab_focus();
+ if (m_xConfirmFailedDialog)
+ m_xConfirmFailedDialog->response(RET_CANCEL);
+
+ m_xConfirmFailedDialog =
+ std::shared_ptr<weld::MessageDialog>(Application::CreateMessageDialog(m_xDialog.get(),
+ VclMessageType::Warning, VclButtonsType::Ok,
+ SfxResId(STR_ERROR_WRONG_CONFIRM)));
+ m_xConfirmFailedDialog->runAsync(m_xConfirmFailedDialog, [this](sal_uInt32 response){
+ m_xConfirm1ED->set_text(OUString());
+ m_xConfirm1ED->grab_focus();
+ m_xConfirmFailedDialog->response(response);
+ });
}
else
m_xDialog->response(RET_OK);
@@ -165,7 +171,7 @@ void SfxPasswordDialog::AllowAsciiOnly()
m_xOnlyAsciiFT->show();
}
-short SfxPasswordDialog::run()
+void SfxPasswordDialog::PreRun()
{
m_xUserFT->hide();
m_xUserED->hide();
@@ -202,8 +208,18 @@ short SfxPasswordDialog::run()
m_xConfirm2FT->show();
m_xConfirm2ED->show();
}
+}
+
+short SfxPasswordDialog::run()
+{
+ PreRun();
return GenericDialogController::run();
}
+SfxPasswordDialog::~SfxPasswordDialog()
+{
+ if (m_xConfirmFailedDialog)
+ m_xConfirmFailedDialog->response(RET_CANCEL);
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */