12 #include <com/sun/star/beans/XPropertySet.hpp>
13 #include <com/sun/star/embed/XStorage.hpp>
14 #include <com/sun/star/frame/XModel.hpp>
15 #include <com/sun/star/frame/XStorable.hpp>
16 #include <com/sun/star/graphic/XGraphic.hpp>
17 #include <com/sun/star/security/DocumentDigitalSignatures.hpp>
18 #include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
19 #include <com/sun/star/xml/sax/XAttributeList.hpp>
40 const Reference<XFastAttributeList>& xAttrList,
41 const Reference<XShape>& rxShape)
46 xPropSet->setPropertyValue(
"IsSignatureLine",
Any(
true));
48 xPropSet->setPropertyValue(
"SignatureLineId",
50 xPropSet->setPropertyValue(
51 "SignatureLineSuggestedSignerName",
53 xPropSet->setPropertyValue(
54 "SignatureLineSuggestedSignerTitle",
56 xPropSet->setPropertyValue(
57 "SignatureLineSuggestedSignerEmail",
59 xPropSet->setPropertyValue(
60 "SignatureLineSigningInstructions",
67 xPropSet->setPropertyValue(
"SignatureLineShowSignDate",
Any(bShowSignDate));
68 xPropSet->setPropertyValue(
"SignatureLineCanAddComment",
Any(bCanAddComment));
71 Reference<XGraphic> xUnsignedGraphic;
72 xPropSet->getPropertyValue(
"Graphic") >>= xUnsignedGraphic;
73 if (xUnsignedGraphic.is())
74 xPropSet->setPropertyValue(
"SignatureLineUnsignedImage",
Any(xUnsignedGraphic));
80 css::uno::Reference<XStorable> xStorable(
GetImport().GetModel(), UNO_QUERY_THROW);
91 Reference<XDocumentDigitalSignatures> xSignatures(
92 security::DocumentDigitalSignatures::createWithVersion(
95 Sequence<DocumentSignatureInformation> xSignatureInfo
101 = std::find_if(xSignatureInfo.begin(), xSignatureInfo.end(),
102 [&xAttrList](
const DocumentSignatureInformation& rSignatureInfo) {
103 return rSignatureInfo.SignatureLineId
106 bool bIsSigned(
false);
107 if (pSignatureInfo != xSignatureInfo.end())
110 if (pSignatureInfo->SignatureIsValid)
113 SAL_WARN_IF(!pSignatureInfo->ValidSignatureLineImage.is(),
"xmloff",
114 "No ValidSignatureLineImage!");
115 xGraphic = pSignatureInfo->ValidSignatureLineImage;
120 SAL_WARN_IF(!pSignatureInfo->InvalidSignatureLineImage.is(),
"xmloff",
121 "No InvalidSignatureLineImage!");
122 xGraphic = pSignatureInfo->InvalidSignatureLineImage;
125 xPropSet->setPropertyValue(
"Graphic",
Any(xGraphic));
127 xPropSet->setPropertyValue(
"SignatureLineIsSigned",
Any(bIsSigned));
129 catch (css::uno::Exception&)
SvXMLImport & GetImport()
static css::uno::Reference< css::embed::XStorage > GetStorageOfFormatFromURL(const OUString &aFormat, const OUString &aURL, sal_Int32 nStorageMode, const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >())
This class deliberately does not support XWeak, to improve performance when loading large documents...
#define SAL_WARN_IF(condition, area, stream)
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
Handling of tokens in XML:
SignatureLineContext(SvXMLImport &rImport, sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList, const css::uno::Reference< css::drawing::XShape > &rxShape)
#define XML_ELEMENT(prefix, name)
#define ZIP_STORAGE_FORMAT_STRING
Reference< XComponentContext > getProcessComponentContext()
static OUString GetODFVersionFromStorage(const css::uno::Reference< css::embed::XStorage > &xStorage)
#define SAL_WARN(area, stream)
Reference< XGraphic > xGraphic