summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2018-05-17 13:35:31 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2018-05-22 06:55:27 +0200
commit13596e704e4b48e8b0892867b3f3fc351a2729f9 (patch)
tree7f01a97e67ecff6f0a75244db47c8a1190bf14fa /sfx2
parent99337b029a3f94257160077ecf11ee3c59c77b7c (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>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/docfile.cxx3
-rw-r--r--sfx2/source/doc/objserv.cxx9
2 files changed, 5 insertions, 7 deletions
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);
}