From fb9874231fb242b4a6a7d1ce097e66dd4ed8f32e Mon Sep 17 00:00:00 2001 From: TokieSan Date: Sat, 5 Aug 2023 18:26:55 +0300 Subject: Caching Certificates in the CertificateChooser dialog session-wise Added the functionality of caching certificates per session using a single instance with internal memoization. Added Reload Certificates button in case of certificate changes in-session. Updated all instances of certifcate chooser in the codebase to work with the new change. Change-Id: Icb25a2b2e9787b029fa6189f70bd4ba3b6806f60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155373 Tested-by: Jenkins Reviewed-by: Thorsten Behrens --- xmlsecurity/source/component/documentdigitalsignatures.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'xmlsecurity/source/component') diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx index 0fd029fc2d81..4ad63b36ed0b 100644 --- a/xmlsecurity/source/component/documentdigitalsignatures.cxx +++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx @@ -709,14 +709,14 @@ DocumentDigitalSignatures::chooseCertificatesImpl(std::map& xSecContexts.push_back(aSignatureManager.getGpgSecurityContext()); } - CertificateChooser aChooser(Application::GetFrameWeld(mxParentWindow), std::move(xSecContexts), eAction); + CertificateChooser* aChooser = CertificateChooser::getInstance(Application::GetFrameWeld(mxParentWindow), std::move(xSecContexts), eAction); - if (aChooser.run() != RET_OK) + if (aChooser->run() != RET_OK) return { Reference< css::security::XCertificate >(nullptr) }; - uno::Sequence< Reference< css::security::XCertificate > > xCerts = aChooser.GetSelectedCertificates(); - rProperties["Description"] = aChooser.GetDescription(); - rProperties["Usage"] = aChooser.GetUsageText(); + uno::Sequence< Reference< css::security::XCertificate > > xCerts = aChooser->GetSelectedCertificates(); + rProperties["Description"] = aChooser->GetDescription(); + rProperties["Usage"] = aChooser->GetUsageText(); return xCerts; } -- cgit