[Libreoffice-commits] core.git: sfx2/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Sep 17 13:41:56 UTC 2018


 sfx2/source/doc/objserv.cxx |   12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

New commits:
commit 408ea1f0d449fdcd2ddaa50155c7a1a26a048ca8
Author:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Mon Sep 17 10:32:59 2018 +0200
Commit:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Mon Sep 17 15:41:34 2018 +0200

    Only check ODF version when signing ODF
    
    This allows signing ooxml when an older default ODF version
    has been configured.
    
    Change-Id: I8e44caa2795c1da445895dd68d8cc60370c5747c
    Reviewed-on: https://gerrit.libreoffice.org/60560
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 6cfed0679a4a..3874f21cd56b 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1416,15 +1416,7 @@ bool SfxObjectShell::PrepareForSigning(weld::Window* pDialogParent)
         ImplGetSignatureState( true ); // script signature
     bool bHasSign = ( pImpl->nScriptingSignatureState != SignatureState::NOSIGNATURES || pImpl->nDocumentSignatureState != SignatureState::NOSIGNATURES );
 
-    // the target ODF version on saving
-
-    // Please fix this comment if you can: Note that the talk about "ODF version" around here is a
-    // bit silly, as there should be nothing ODF-specific in this code, right? What we mean, I
-    // think, is "ODF version iff it is ODF that is the format the document is being stored as", and
-    // otherwise the "ODF version" is ignored. Not sure why such format-specific things needs to be
-    // handled here. Digital signatures then complicate matters further, as it's only ODF 1.2 and
-    // OOXML that have digital signatures.
-
+    // the target ODF version on saving (only valid when signing ODF of course)
     SvtSaveOptions aSaveOpt;
     SvtSaveOptions::ODFDefaultVersion nVersion = aSaveOpt.GetODFDefaultVersion();
 
@@ -1432,7 +1424,7 @@ bool SfxObjectShell::PrepareForSigning(weld::Window* pDialogParent)
     OUString aODFVersion(comphelper::OStorageHelper::GetODFVersionFromStorage(GetStorage()));
 
     if ( IsModified() || !GetMedium() || GetMedium()->GetName().isEmpty()
-      || (aODFVersion != ODFVER_012_TEXT && !bHasSign) )
+      || (GetMedium()->GetFilter()->IsOwnFormat() && aODFVersion != ODFVER_012_TEXT && !bHasSign) )
     {
         // the document might need saving ( new, modified or in ODF1.1 format without signature )
 


More information about the Libreoffice-commits mailing list