From c13ec26f6a20bc9a0e3e4fd8f03d8f4e1d46c7d1 Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Fri, 22 Oct 2021 13:08:46 +0200 Subject: Make View Certificate dialog async MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Id93145ecf6be3cb558f0ce8d3cc340bbc67095e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124061 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128839 Tested-by: Jenkins --- xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'xmlsecurity/source') diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 621ea4170649..fc7cf6b2a534 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -204,6 +204,8 @@ DigitalSignaturesDialog::DigitalSignaturesDialog( DigitalSignaturesDialog::~DigitalSignaturesDialog() { + if (m_xViewer) + m_xViewer->response(RET_OK); } bool DigitalSignaturesDialog::Init() @@ -774,9 +776,12 @@ void DigitalSignaturesDialog::ImplShowSignaturesDetails() if ( xCert.is() ) { + if (m_xViewer) + m_xViewer->response(RET_OK); + uno::Reference xSecEnv = getSecurityEnvironmentForCertificate(xCert); - CertificateViewer aViewer(m_xDialog.get(), xSecEnv, xCert, false, nullptr); - aViewer.run(); + m_xViewer = std::make_shared(m_xDialog.get(), xSecEnv, xCert, false, nullptr); + weld::DialogController::runAsync(m_xViewer, [this] (sal_Int32) { m_xViewer = nullptr; }); } else { -- cgit