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

New commits:
commit 1c7f6188eb5b2a2bbf0cf589843d644306e40d6d
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Wed Oct 2 08:42:26 2024 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Wed Oct 2 09:49:04 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 <vmik...@collabora.com>
    Tested-by: Jenkins

diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index a6ac42734c17..12c28f4e614d 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -538,6 +538,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