sw/qa/extras/htmlexport/htmlexport.cxx  |   20 ++++++++++++++++++++
 sw/qa/extras/inc/swmodeltestbase.hxx    |    2 ++
 sw/source/filter/html/htmlflywriter.cxx |    1 +
 3 files changed, 23 insertions(+)

New commits:
commit 1a884ea69b2c8b98719fa3cd298b42a6d584cd41
Author:     Miklos Vajna <vmik...@collabora.co.uk>
AuthorDate: Wed Jul 18 14:00:29 2018 +0200
Commit:     Miklos Vajna <vmik...@collabora.co.uk>
CommitDate: Wed Jul 18 18:21:29 2018 +0200

    sw HTML export: force PNG output harder in reqif mode
    
    Need to disable one more flag to avoid GIF for transparent images.
    
    Also start asserting reqif-xhtml output with an XML parser.
    
    Change-Id: I1395812a5ddfd56cee4acacf6dea46c6e413b736
    Reviewed-on: https://gerrit.libreoffice.org/57630
    Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>
    Tested-by: Jenkins

diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx 
b/sw/qa/extras/htmlexport/htmlexport.cxx
index 9c5724f7212e..696ca6041dad 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -600,6 +600,26 @@ DECLARE_HTMLEXPORT_TEST(testTransparentImage, 
"transparent-image.odt")
     CPPUNIT_ASSERT_MESSAGE(aMessage.toUtf8().getStr(), 
aSource.endsWith(".gif"));
 }
 
+DECLARE_HTMLEXPORT_TEST(testTransparentImageReqIf, "transparent-image.odt")
+{
+    SvMemoryStream aStream;
+    aStream.WriteCharPtr("<reqif-xhtml:html 
xmlns:reqif-xhtml=\"http://www.w3.org/1999/xhtml\";>\n");
+    SvFileStream aFileStream(maTempFile.GetURL(), StreamMode::READ);
+    aStream.WriteStream(aFileStream);
+    aStream.WriteCharPtr("</reqif-xhtml:html>\n");
+    aStream.Seek(0);
+    xmlDocPtr pDoc = parseXmlStream(&aStream);
+    CPPUNIT_ASSERT(pDoc);
+
+    OUString aSource = getXPath(
+        pDoc,
+        
"/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p/reqif-xhtml:object/reqif-xhtml:object",
+        "data");
+    OUString aMessage = "src attribute is: " + aSource;
+    // This was GIF, when the intention was to force PNG.
+    CPPUNIT_ASSERT_MESSAGE(aMessage.toUtf8().getStr(), 
aSource.endsWith(".png"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx 
b/sw/qa/extras/inc/swmodeltestbase.hxx
index 3bcc7116b091..d3d64c8ea434 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -997,6 +997,8 @@ protected:
         xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("field"), 
BAD_CAST("urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0"));
         xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("formx"), 
BAD_CAST("urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"));
         xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("css3t"), 
BAD_CAST("http://www.w3.org/TR/css3-text/";));
+        // reqif-xhtml
+        xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("reqif-xhtml"), 
BAD_CAST("http://www.w3.org/1999/xhtml";));
     }
 };
 
diff --git a/sw/source/filter/html/htmlflywriter.cxx 
b/sw/source/filter/html/htmlflywriter.cxx
index 6db21469f368..79b111405704 100644
--- a/sw/source/filter/html/htmlflywriter.cxx
+++ b/sw/source/filter/html/htmlflywriter.cxx
@@ -1837,6 +1837,7 @@ static Writer& OutHTML_FrameFormatGrfNode( Writer& rWrt, 
const SwFrameFormat& rF
                 // output.
                 aFilterName = "PNG";
                 nFlags &= ~XOutFlags::UseNativeIfPossible;
+                nFlags &= ~XOutFlags::UseGifIfSensible;
                 aMimeType = "image/png";
             }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to