Kaydet (Commit) 13596e70 authored tarafından Samuel Mehrbrodt's avatar Samuel Mehrbrodt

Don't pass ODF version, just retrieve it directly

Change-Id: I19ff42c348515b17dac17abe750ee03ca53efcbf
Reviewed-on: https://gerrit.libreoffice.org/54483Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
üst 99337b02
...@@ -266,8 +266,7 @@ public: ...@@ -266,8 +266,7 @@ public:
SAL_DLLPRIVATE bool SAL_DLLPRIVATE bool
SignContents_Impl(const css::uno::Reference<css::security::XCertificate> xCert, SignContents_Impl(const css::uno::Reference<css::security::XCertificate> xCert,
const OUString& aSignatureLineId, const OUString& aSignatureLineId,
bool bSignScriptingContent, const OUString& aODFVersion, bool bSignScriptingContent, bool bHasValidDocumentSignature);
bool bHasValidDocumentSignature);
// the following two methods must be used and make sense only during saving currently // 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 // TODO/LATER: in future the signature state should be controlled by the medium not by the document
......
...@@ -3662,7 +3662,7 @@ void SfxMedium::CreateTempFileNoCopy() ...@@ -3662,7 +3662,7 @@ void SfxMedium::CreateTempFileNoCopy()
} }
bool SfxMedium::SignContents_Impl(const Reference<XCertificate> xCert, const OUString& aSignatureLineId, bool SfxMedium::SignContents_Impl(const Reference<XCertificate> xCert, const OUString& aSignatureLineId,
bool bSignScriptingContent, const OUString& aODFVersion, bool bSignScriptingContent,
bool bHasValidDocumentSignature) bool bHasValidDocumentSignature)
{ {
bool bChanges = false; bool bChanges = false;
...@@ -3675,6 +3675,7 @@ bool SfxMedium::SignContents_Impl(const Reference<XCertificate> xCert, const OUS ...@@ -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 // The component should know if there was a valid document signature, since
// it should show a warning in this case // it should show a warning in this case
OUString aODFVersion(comphelper::OStorageHelper::GetODFVersionFromStorage(GetStorage()));
uno::Reference< security::XDocumentDigitalSignatures > xSigner( uno::Reference< security::XDocumentDigitalSignatures > xSigner(
security::DocumentDigitalSignatures::createWithVersionAndValidSignature( security::DocumentDigitalSignatures::createWithVersionAndValidSignature(
comphelper::getProcessComponentContext(), aODFVersion, bHasValidDocumentSignature ) ); comphelper::getProcessComponentContext(), aODFVersion, bHasValidDocumentSignature ) );
......
...@@ -1556,9 +1556,8 @@ void SfxObjectShell::SignDocumentContent() ...@@ -1556,9 +1556,8 @@ void SfxObjectShell::SignDocumentContent()
if (CheckIsReadonly(false)) if (CheckIsReadonly(false))
return; return;
OUString aODFVersion(comphelper::OStorageHelper::GetODFVersionFromStorage(GetStorage()));
bool bSignSuccess = GetMedium()->SignContents_Impl( bool bSignSuccess = GetMedium()->SignContents_Impl(
Reference<XCertificate>(), "", false, aODFVersion, HasValidSignatures()); Reference<XCertificate>(), "", false, HasValidSignatures());
AfterSigning(bSignSuccess, false); AfterSigning(bSignSuccess, false);
} }
...@@ -1572,9 +1571,8 @@ void SfxObjectShell::SignSignatureLine(const OUString& aSignatureLineId, ...@@ -1572,9 +1571,8 @@ void SfxObjectShell::SignSignatureLine(const OUString& aSignatureLineId,
if (CheckIsReadonly(false)) if (CheckIsReadonly(false))
return; return;
OUString aODFVersion(comphelper::OStorageHelper::GetODFVersionFromStorage(GetStorage()));
bool bSignSuccess = GetMedium()->SignContents_Impl( bool bSignSuccess = GetMedium()->SignContents_Impl(
xCert, aSignatureLineId, false, aODFVersion, HasValidSignatures()); xCert, aSignatureLineId, false, HasValidSignatures());
AfterSigning(bSignSuccess, false); AfterSigning(bSignSuccess, false);
} }
...@@ -1592,9 +1590,8 @@ void SfxObjectShell::SignScriptingContent() ...@@ -1592,9 +1590,8 @@ void SfxObjectShell::SignScriptingContent()
if (CheckIsReadonly(true)) if (CheckIsReadonly(true))
return; return;
OUString aODFVersion(comphelper::OStorageHelper::GetODFVersionFromStorage(GetStorage()));
bool bSignSuccess = GetMedium()->SignContents_Impl( bool bSignSuccess = GetMedium()->SignContents_Impl(
Reference<XCertificate>(), OUString(), true, aODFVersion, HasValidSignatures()); Reference<XCertificate>(), OUString(), true, HasValidSignatures());
AfterSigning(bSignSuccess, true); AfterSigning(bSignSuccess, true);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment