sfx2/source/doc/objserv.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 1cb191e6fc1c934de1d6405f8f05698418ca1dc5
Author:     Miklos Vajna <[email protected]>
AuthorDate: Wed Oct 2 08:42:26 2024 +0200
Commit:     Caolán McNamara <[email protected]>
CommitDate: Thu Oct 3 10:39:11 2024 +0200

    cool#9992 lok doc sign: avoid storing the sign cert in the model after sign
    
    Open the signatures dialog in LOK mode, add a signature, close it, you
    get a (non-async) popup asking if you want to automatically re-sign the
    document on each save in the future.
    
    This makes sense when only one user edits the document, but the LOK mode
    stores the signing certificates in the view, so this would mean user A
    can enable this mode, then user B could edit + save, which is not
    wanted.
    
    Fix the problem by just not offering this functionality in LOK mode,
    where we assume that certificates are per-view and the save works on the
    model.
    
    Change-Id: I180fc2e6078623d44f8414f7891481218df7cebd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174369
    Reviewed-by: Miklos Vajna <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit 1c7f6188eb5b2a2bbf0cf589843d644306e40d6d)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174415
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 5f791ea2e541..bb29a897f127 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -539,6 +539,12 @@ void SetDocProperties(const 
uno::Reference<document::XDocumentProperties>& xDP,
 
 void SfxObjectShell::AfterSignContent(bool bHaveWeSigned, weld::Window* 
pDialogParent)
 {
+    if (comphelper::LibreOfficeKit::isActive())
+    {
+        // LOK signing certificates are per-view, don't store them in the 
model.
+        return;
+    }
+
     if ( bHaveWeSigned && HasValidSignatures() )
     {
         std::unique_ptr<weld::MessageDialog> 
xBox(Application::CreateMessageDialog( pDialogParent,

Reply via email to