From 2990c7ea4da17e555903ff8854c03b71aa7ecddd Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 22 Oct 2024 14:02:57 +0200 Subject: cool#9992 lok doc sign: never remember previous .uno:Signature params MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do this explicitly, so it can't happen that .uno:Signature with params gets dispatched, then .uno:Signature without params still has the old XCertificate. Change-Id: I35c4d5e0e4545fb1aabb9050aa6b11cd10c3ca85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175409 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara Tested-by: Jenkins CollaboraOffice --- sfx2/source/doc/objserv.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'sfx2') diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 096c97344b3b..35efc6dcf60c 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -630,10 +630,15 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) } SfxViewFrame* pFrame = GetFrame(); SfxViewShell* pViewShell = pFrame ? pFrame->GetViewShell() : nullptr; - if (!aSignatureCert.empty() && !aSignatureKey.empty() && pViewShell) + if (pViewShell) { - xCertificate = SfxLokHelper::getSigningCertificate(aSignatureCert, aSignatureKey); - pViewShell->SetSigningCertificate(xCertificate); + uno::Reference xSigningCertificate; + if (!aSignatureCert.empty() && !aSignatureKey.empty()) + { + xSigningCertificate = SfxLokHelper::getSigningCertificate(aSignatureCert, aSignatureKey); + } + // Always set the signing certificate, to clear data from a previous dispatch. + pViewShell->SetSigningCertificate(xSigningCertificate); } // Async, all code before return has to go into the callback. -- cgit