[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - sw/qa xmloff/source

Samuel Mehrbrodt (via logerrit) logerrit at kemper.freedesktop.org
Fri Feb 28 14:01:31 UTC 2020


 sw/qa/extras/odfexport/odfexport.cxx        |    6 ++++++
 xmloff/source/draw/SignatureLineContext.cxx |   12 ++++++------
 2 files changed, 12 insertions(+), 6 deletions(-)

New commits:
commit 0f02805a8949865ffee99477bb26491b7c27a8bc
Author:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Fri Feb 28 11:16:14 2020 +0100
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Fri Feb 28 15:00:47 2020 +0100

    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 at cib.de>
    Tested-by: Jenkins

diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index d297ac2893d1..4e92701e385e 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -2120,6 +2120,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 c95dfc8c72da..0e0e31bd9f27 100644
--- a/xmloff/source/draw/SignatureLineContext.cxx
+++ b/xmloff/source/draw/SignatureLineContext.cxx
@@ -60,6 +60,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
@@ -104,12 +110,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;
             }


More information about the Libreoffice-commits mailing list