diff options
author | TokieSan <eltokhy@aucegypt.edu> | 2023-08-05 18:26:55 +0300 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2023-08-26 00:59:48 +0200 |
commit | fb9874231fb242b4a6a7d1ce097e66dd4ed8f32e (patch) | |
tree | fc3b69b97247bcaf5b4f318e6e61a4c6eb4e60ec /xmlsecurity/source/component/documentdigitalsignatures.cxx | |
parent | 6e042b1e26bedcc8d8bdcf105ec750b03665c7b0 (diff) |
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 <thorsten.behrens@allotropia.de>
Diffstat (limited to 'xmlsecurity/source/component/documentdigitalsignatures.cxx')
-rw-r--r-- | xmlsecurity/source/component/documentdigitalsignatures.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
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<OUString, OUString>& 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; } |