Kaydet (Commit) bfd613a4 authored tarafından Samuel Mehrbrodt's avatar Samuel Mehrbrodt

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/45153Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
üst 6b0a2d19
......@@ -217,6 +217,7 @@ private:
SAL_DLLPRIVATE void ImpExportEvents( const css::uno::Reference< css::drawing::XShape >& xShape );
SAL_DLLPRIVATE void ImpExportDescription( const css::uno::Reference< css::drawing::XShape >& xShape ); // #i68101#
SAL_DLLPRIVATE void ImpExportGluePoints( const css::uno::Reference< css::drawing::XShape >& xShape );
SAL_DLLPRIVATE void ImpExportSignatureLine(const css::uno::Reference<css::drawing::XShape>& xShape);
// single shape exporters
SAL_DLLPRIVATE void ImpExportGroupShape( const css::uno::Reference< css::drawing::XShape >& xShape, XMLShapeExportFlags nFeatures = SEF_DEFAULT, css::awt::Point* pRefPoint = nullptr );
......
......@@ -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() )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment