summaryrefslogtreecommitdiff
path: root/xmloff/source/draw
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-04-28 16:53:57 +0200
committerMichael Stahl <michael.stahl@cib.de>2020-05-15 17:56:23 +0200
commite125c6c6693d4540ab3aacb11151e05b511b8051 (patch)
treea81d88af3559f2c8da57a49bdee4ff6dfd2ba627 /xmloff/source/draw
parentbb6af185cb7a88dfc73ad067d928625f0a2ed590 (diff)
replace hard-coded "1.2" ODF version strings
Most of these are calls to DocumentDigitalSignatures::createWithVersion(), where it doesn't make a difference if "1.2" or "1.3" is passed in but maybe it will be different with "1.4". There is another ctor createDefault() which looks appropriate for non-ODF contexts and can also be used when no actual signing or verifying is done. In cases where there's an actual document its Storage has the version. Change-Id: Id636bbf965d9f96c7ed5f50774c509032525b2b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93091 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'xmloff/source/draw')
-rw-r--r--xmloff/source/draw/SignatureLineContext.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/xmloff/source/draw/SignatureLineContext.cxx b/xmloff/source/draw/SignatureLineContext.cxx
index 10c2440fd022..497bd8489c70 100644
--- a/xmloff/source/draw/SignatureLineContext.cxx
+++ b/xmloff/source/draw/SignatureLineContext.cxx
@@ -72,10 +72,6 @@ SignatureLineContext::SignatureLineContext(SvXMLImport& rImport, sal_uInt16 nPrf
try
{
// Get the document signatures
- Reference<XDocumentDigitalSignatures> xSignatures(
- security::DocumentDigitalSignatures::createWithVersion(
- comphelper::getProcessComponentContext(), "1.2"));
-
css::uno::Reference<XStorable> xStorable(GetImport().GetModel(), UNO_QUERY_THROW);
Reference<XStorage> xStorage = comphelper::OStorageHelper::GetStorageOfFormatFromURL(
ZIP_STORAGE_FORMAT_STRING, xStorable->getLocation(), ElementModes::READ);
@@ -86,6 +82,11 @@ SignatureLineContext::SignatureLineContext(SvXMLImport& rImport, sal_uInt16 nPrf
return;
}
+ OUString const aODFVersion(comphelper::OStorageHelper::GetODFVersionFromStorage(xStorage));
+ Reference<XDocumentDigitalSignatures> xSignatures(
+ security::DocumentDigitalSignatures::createWithVersion(
+ comphelper::getProcessComponentContext(), aODFVersion));
+
Sequence<DocumentSignatureInformation> xSignatureInfo
= xSignatures->verifyDocumentContentSignatures(xStorage, Reference<XInputStream>());