summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-02-28 11:16:14 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-03-06 15:37:57 +0100
commit4eb742b8e31546d8e0d04846876902b38c530401 (patch)
tree604192e59e6867d9e5933a52295b89f38e307520
parent447b2c6b52a29f091da7b6403ee82e796b64acc2 (diff)
tdf#130917 Invalid document after odt->docx with signatureline
Change-Id: Idf80c41f1315e0690dabd5e8566b62fc64c3ee1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89674 Reviewed-by: Michael Stahl <michael.stahl@cib.de> Tested-by: Jenkins (cherry picked from commit 0f02805a8949865ffee99477bb26491b7c27a8bc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89907 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx6
-rw-r--r--xmloff/source/draw/SignatureLineContext.cxx12
2 files changed, 12 insertions, 6 deletions
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index ad91e8aa6461..62362d4a3a15 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -2038,6 +2038,12 @@ DECLARE_ODFEXPORT_TEST(testSignatureLineProperties, "signatureline-properties.fo
getProperty<OUString>(xShape, "SignatureLineSigningInstructions"));
CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xShape, "SignatureLineCanAddComment"));
CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xShape, "SignatureLineShowSignDate"));
+
+ // tdf#130917 This needs to be always set when importing a doc, ooxml export expects it.
+ uno::Reference<graphic::XGraphic> xUnsignedGraphic;
+ uno::Reference<beans::XPropertySet> xProps(xShape, uno::UNO_QUERY);
+ xProps->getPropertyValue("SignatureLineUnsignedImage") >>= xUnsignedGraphic;
+ CPPUNIT_ASSERT_EQUAL(true, xUnsignedGraphic.is());
}
DECLARE_ODFEXPORT_TEST(testChapterNumberingNewLine, "chapter-number-new-line.odt")
diff --git a/xmloff/source/draw/SignatureLineContext.cxx b/xmloff/source/draw/SignatureLineContext.cxx
index 36a9a688a80d..0b0e158a37db 100644
--- a/xmloff/source/draw/SignatureLineContext.cxx
+++ b/xmloff/source/draw/SignatureLineContext.cxx
@@ -59,6 +59,12 @@ SignatureLineContext::SignatureLineContext(SvXMLImport& rImport, sal_uInt16 nPrf
xPropSet->setPropertyValue("SignatureLineShowSignDate", Any(bShowSignDate));
xPropSet->setPropertyValue("SignatureLineCanAddComment", Any(bCanAddComment));
+ // Save unsigned graphic (need it when exporting)
+ Reference<XGraphic> xUnsignedGraphic;
+ xPropSet->getPropertyValue("Graphic") >>= xUnsignedGraphic;
+ if (xUnsignedGraphic.is())
+ xPropSet->setPropertyValue("SignatureLineUnsignedImage", Any(xUnsignedGraphic));
+
Reference<XGraphic> xGraphic;
bool bIsSigned(false);
try
@@ -103,12 +109,6 @@ SignatureLineContext::SignatureLineContext(SvXMLImport& rImport, sal_uInt16 nPrf
xGraphic = xSignatureInfo[i].InvalidSignatureLineImage;
}
- // Save unsigned graphic
- Reference<XGraphic> xUnsignedGraphic;
- xPropSet->getPropertyValue("Graphic") >>= xUnsignedGraphic;
- if (xUnsignedGraphic.is())
- xPropSet->setPropertyValue("SignatureLineUnsignedImage", Any(xUnsignedGraphic));
-
xPropSet->setPropertyValue("Graphic", Any(xGraphic));
break;
}