diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-05-17 13:35:31 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-05-22 06:55:27 +0200 |
commit | 13596e704e4b48e8b0892867b3f3fc351a2729f9 (patch) | |
tree | 7f01a97e67ecff6f0a75244db47c8a1190bf14fa | |
parent | 99337b029a3f94257160077ecf11ee3c59c77b7c (diff) |
Don't pass ODF version, just retrieve it directly
Change-Id: I19ff42c348515b17dac17abe750ee03ca53efcbf
Reviewed-on: https://gerrit.libreoffice.org/54483
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
-rw-r--r-- | include/sfx2/docfile.hxx | 3 | ||||
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/doc/objserv.cxx | 9 |
3 files changed, 6 insertions, 9 deletions
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); } |