// Save unsigned graphic (need it when exporting)
Reference<XGraphic> xUnsignedGraphic;
xPropSet->getPropertyValue(u"Graphic"_ustr) >>= xUnsignedGraphic; if (xUnsignedGraphic.is())
xPropSet->setPropertyValue(u"SignatureLineUnsignedImage"_ustr, Any(xUnsignedGraphic));
Reference<XGraphic> xGraphic; try
{ // Get the document signatures
css::uno::Reference<XStorable> xStorable(GetImport().GetModel(), UNO_QUERY_THROW);
Reference<XStorage> xStorage = comphelper::OStorageHelper::GetStorageOfFormatFromURL(
ZIP_STORAGE_FORMAT_STRING, xStorable->getLocation(), ElementModes::READ);
if (!xStorage.is())
{
SAL_WARN("xmloff", "No xStorage!"); return;
}
// Try to find matching signature line image - if none exists that is fine, // then the signature line is not digitally signed. auto pSignatureInfo
= std::find_if(xSignatureInfo.begin(), xSignatureInfo.end(),
[&xAttrList](const DocumentSignatureInformation& rSignatureInfo) { return rSignatureInfo.SignatureLineId
== xAttrList->getOptionalValue(XML_ELEMENT(LO_EXT, XML_ID));
}); bool bIsSigned(false); if (pSignatureInfo != xSignatureInfo.end())
{
bIsSigned = true; if (pSignatureInfo->SignatureIsValid)
{ // Signature is valid, use the 'valid' image
SAL_WARN_IF(!pSignatureInfo->ValidSignatureLineImage.is(), "xmloff", "No ValidSignatureLineImage!");
xGraphic = pSignatureInfo->ValidSignatureLineImage;
} else
{ // Signature is invalid, use the 'invalid' image
SAL_WARN_IF(!pSignatureInfo->InvalidSignatureLineImage.is(), "xmloff", "No InvalidSignatureLineImage!");
xGraphic = pSignatureInfo->InvalidSignatureLineImage;
}
xPropSet->setPropertyValue(u"Graphic"_ustr, Any(xGraphic));
}
xPropSet->setPropertyValue(u"SignatureLineIsSigned"_ustr, Any(bIsSigned));
} catch (css::uno::Exception&)
{ // DocumentDigitalSignatures service not available. // We render the "unsigned" shape instead.
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.