diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2017-11-23 15:06:08 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2017-12-04 17:26:17 +0100 |
commit | bfd613a4628c8827168f64fc2a97685785d04a84 (patch) | |
tree | 086cabb7f0a53238628020321c432d5642cebea0 /xmloff | |
parent | 6b0a2d193aa8974baef5e7d585521baad6078e3e (diff) |
tdf#83877 ODF extension to write signature lines
This adds a <loext:signatureline> element to draw:image if the image
is a signatureline.
Example:
<draw:image xlink:href="...">
<loext:signatureline loext:id="..." loext:suggested-signer-name="..." loext:suggested-signer-title="..." loext:suggested-signer-email="..." loext:signing-instructions="..." loext:show-sign-date="true" loext:can-add-comment="false"/>
</draw:image>
Change-Id: I4d77acec528175fba66556661ab74462f5bd875f
Reviewed-on: https://gerrit.libreoffice.org/45153
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 887f5ecfd372..86b4f621b182 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -1256,6 +1256,53 @@ void XMLShapeExport::ImpExportGluePoints( const uno::Reference< drawing::XShape } } +void XMLShapeExport::ImpExportSignatureLine(const uno::Reference<drawing::XShape>& xShape) +{ + uno::Reference<beans::XPropertySet> xPropSet(xShape, uno::UNO_QUERY); + + bool bIsSignatureLine = false; + xPropSet->getPropertyValue("IsSignatureLine") >>= bIsSignatureLine; + if (!bIsSignatureLine) + return; + + OUString aSignatureLineId; + xPropSet->getPropertyValue("SignatureLineId") >>= aSignatureLineId; + mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "id", aSignatureLineId); + + OUString aSuggestedSignerName; + xPropSet->getPropertyValue("SignatureLineSuggestedSignerName") >>= aSuggestedSignerName; + if (!aSuggestedSignerName.isEmpty()) + mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "suggested-signer-name", aSuggestedSignerName); + + OUString aSuggestedSignerTitle; + xPropSet->getPropertyValue("SignatureLineSuggestedSignerTitle") >>= aSuggestedSignerTitle; + if (!aSuggestedSignerTitle.isEmpty()) + mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "suggested-signer-title", aSuggestedSignerTitle); + + OUString aSuggestedSignerEmail; + xPropSet->getPropertyValue("SignatureLineSuggestedSignerEmail") >>= aSuggestedSignerEmail; + if (!aSuggestedSignerEmail.isEmpty()) + mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "suggested-signer-email", aSuggestedSignerEmail); + + OUString aSigningInstructions; + xPropSet->getPropertyValue("SignatureLineSigningInstructions") >>= aSigningInstructions; + if (!aSigningInstructions.isEmpty()) + mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "signing-instructions", aSigningInstructions); + + bool bShowSignDate = false; + xPropSet->getPropertyValue("SignatureLineShowSignDate") >>= bShowSignDate; + mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "show-sign-date", + bShowSignDate ? OUString("true") : OUString("false")); + + bool bCanAddComment = false; + xPropSet->getPropertyValue("SignatureLineCanAddComment") >>= bCanAddComment; + mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "can-add-comment", + bCanAddComment ? OUString("true") : OUString("false")); + + SvXMLElementExport aSignatureLineElement(mrExport, XML_NAMESPACE_LO_EXT, "signatureline", true, + true); +} + void XMLShapeExport::ExportGraphicDefaults() { rtl::Reference<XMLStyleExport> aStEx(new XMLStyleExport(mrExport, mrExport.GetAutoStylePool().get())); @@ -2364,6 +2411,7 @@ void XMLShapeExport::ImpExportGraphicObjectShape( GetExport().AddAttribute(XML_NAMESPACE_LO_EXT, "mime-type", aMimeType); SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_DRAW, XML_IMAGE, true, true); + ImpExportSignatureLine( xShape ); if( !sImageURL.isEmpty() ) { |