[Libreoffice-commits] core.git: Branch 'distro/vector/vector-5.4' - sw/qa sw/source

Miklos Vajna vmiklos at collabora.co.uk
Tue May 8 07:23:37 UTC 2018


 sw/qa/extras/htmlexport/data/list.html |    4 ++++
 sw/qa/extras/htmlexport/htmlexport.cxx |   13 +++++++++++++
 sw/source/filter/html/htmlatr.cxx      |    3 ++-
 3 files changed, 19 insertions(+), 1 deletion(-)

New commits:
commit 239c8ffc59d99397b12f57d848ec6c1461505106
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon May 7 13:59:58 2018 +0200

    sw HTML export: ensure <li> is not closed before list item content
    
    Seems to be a regression from commit
    c30cf5a3d7902018b0a752fa2060b8f2a2caafc2 (sw html: use HtmlWriter in
    htmlatr in some places, 2014-03-16).
    
    Change-Id: If03b77a43cb2f7d1c9c9c62da7eef9ee9c2b5e91
    Reviewed-on: https://gerrit.libreoffice.org/53937
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Jenkins <ci at libreoffice.org>
    (cherry picked from commit e5834a3967b3b182d1b7b7a5b500aaea2ea423be)

diff --git a/sw/qa/extras/htmlexport/data/list.html b/sw/qa/extras/htmlexport/data/list.html
new file mode 100644
index 000000000000..867521155add
--- /dev/null
+++ b/sw/qa/extras/htmlexport/data/list.html
@@ -0,0 +1,4 @@
+<ul>
+	<li>foo</li>
+	<li>bar</li>
+</ul>
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
index f4f23d0ef59a..b0ef605c3b38 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -529,6 +529,19 @@ DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testReqIfOle2, "reqif-ole2.xhtml")
     // exception of type com.sun.star.io.IOException was thrown.
 }
 
+DECLARE_HTMLEXPORT_TEST(testList, "list.html")
+{
+    SvStream* pStream = maTempFile.GetStream(StreamMode::READ);
+    CPPUNIT_ASSERT(pStream);
+    pStream->Seek(STREAM_SEEK_TO_END);
+    sal_uInt64 nLength = pStream->Tell();
+    pStream->Seek(0);
+    OString aStream(read_uInt8s_ToOString(*pStream, nLength));
+    // This failed, it was <li/>, i.e. list item was closed before content
+    // started.
+    CPPUNIT_ASSERT(aStream.indexOf("<li>") != -1);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index 24fbe2a18b48..83c9718a0ce6 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -763,7 +763,8 @@ void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat,
             rInfo.bOutLi = true;
         }
         else
-            html.endAttribute();
+            // Finish the opening element, but don't close it.
+            html.characters(OString());
     }
 
     if( rHWrt.m_nDefListLvl > 0 && !bForceDL )


More information about the Libreoffice-commits mailing list