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

Samuel Mehrbrodt Samuel.Mehrbrodt at cib.de
Tue May 22 04:55:49 UTC 2018


 include/sfx2/docfile.hxx    |    3 +--
 sfx2/source/doc/docfile.cxx |    3 ++-
 sfx2/source/doc/objserv.cxx |    9 +++------
 3 files changed, 6 insertions(+), 9 deletions(-)

New commits:
commit 13596e704e4b48e8b0892867b3f3fc351a2729f9
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Date:   Thu May 17 13:35:31 2018 +0200

    Don't pass ODF version, just retrieve it directly
    
    Change-Id: I19ff42c348515b17dac17abe750ee03ca53efcbf
    Reviewed-on: https://gerrit.libreoffice.org/54483
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index 7fe4911d3c55..6bf4d740e079 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -266,8 +266,7 @@ public:
     SAL_DLLPRIVATE bool
     SignContents_Impl(const css::uno::Reference<css::security::XCertificate> xCert,
                       const OUString& aSignatureLineId,
-                      bool bSignScriptingContent, const OUString& aODFVersion,
-                      bool bHasValidDocumentSignature);
+                      bool bSignScriptingContent, bool bHasValidDocumentSignature);
 
     // the following two methods must be used and make sense only during saving currently
     // TODO/LATER: in future the signature state should be controlled by the medium not by the document
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 76ca23eb8e1a..093dfbe8557b 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -3662,7 +3662,7 @@ void SfxMedium::CreateTempFileNoCopy()
 }
 
 bool SfxMedium::SignContents_Impl(const Reference<XCertificate> xCert, const OUString& aSignatureLineId,
-                                  bool bSignScriptingContent, const OUString& aODFVersion,
+                                  bool bSignScriptingContent,
                                   bool bHasValidDocumentSignature)
 {
     bool bChanges = false;
@@ -3675,6 +3675,7 @@ bool SfxMedium::SignContents_Impl(const Reference<XCertificate> xCert, const OUS
 
     // The component should know if there was a valid document signature, since
     // it should show a warning in this case
+    OUString aODFVersion(comphelper::OStorageHelper::GetODFVersionFromStorage(GetStorage()));
     uno::Reference< security::XDocumentDigitalSignatures > xSigner(
         security::DocumentDigitalSignatures::createWithVersionAndValidSignature(
             comphelper::getProcessComponentContext(), aODFVersion, bHasValidDocumentSignature ) );
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index c1b81cbf62e0..294ff9473faf 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1556,9 +1556,8 @@ void SfxObjectShell::SignDocumentContent()
     if (CheckIsReadonly(false))
         return;
 
-    OUString aODFVersion(comphelper::OStorageHelper::GetODFVersionFromStorage(GetStorage()));
     bool bSignSuccess = GetMedium()->SignContents_Impl(
-        Reference<XCertificate>(), "", false, aODFVersion, HasValidSignatures());
+        Reference<XCertificate>(), "", false, HasValidSignatures());
 
     AfterSigning(bSignSuccess, false);
 }
@@ -1572,9 +1571,8 @@ void SfxObjectShell::SignSignatureLine(const OUString& aSignatureLineId,
     if (CheckIsReadonly(false))
         return;
 
-    OUString aODFVersion(comphelper::OStorageHelper::GetODFVersionFromStorage(GetStorage()));
     bool bSignSuccess = GetMedium()->SignContents_Impl(
-        xCert, aSignatureLineId, false, aODFVersion, HasValidSignatures());
+        xCert, aSignatureLineId, false, HasValidSignatures());
 
     AfterSigning(bSignSuccess, false);
 }
@@ -1592,9 +1590,8 @@ void SfxObjectShell::SignScriptingContent()
     if (CheckIsReadonly(true))
         return;
 
-    OUString aODFVersion(comphelper::OStorageHelper::GetODFVersionFromStorage(GetStorage()));
     bool bSignSuccess = GetMedium()->SignContents_Impl(
-        Reference<XCertificate>(), OUString(), true, aODFVersion, HasValidSignatures());
+        Reference<XCertificate>(), OUString(), true, HasValidSignatures());
 
     AfterSigning(bSignSuccess, true);
 }


More information about the Libreoffice-commits mailing list