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:
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
......
......@@ -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 ) );
......
......@@ -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);
}
......
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