sw/qa/extras/layout/data/tdf159101.odt |binary
 sw/qa/extras/layout/layout.cxx         |   17 +++++++++++++++++
 2 files changed, 17 insertions(+)

New commits:
commit c8aef3e46256b667f4c777d6a26684df1d4c57f2
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Wed Jan 17 13:20:01 2024 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Jan 17 20:27:35 2024 +0100

    tdf#159101: sw_layoutwriter: Add unittest
    
    Change-Id: I1034e3fdf5f5f5cb4537a980bac704429b4fed30
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162194
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/qa/extras/layout/data/tdf159101.odt 
b/sw/qa/extras/layout/data/tdf159101.odt
new file mode 100644
index 000000000000..e28bf65cc7c3
Binary files /dev/null and b/sw/qa/extras/layout/data/tdf159101.odt differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 668f61f99088..0e7049d55ff7 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -3675,6 +3675,23 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf128611)
     assertXPathContent(pXmlDoc, "//tab/row/cell[1]/txt"_ostr, "Abcd efghijkl");
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf159101)
+{
+    createSwDoc("tdf159101.odt");
+
+    xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+    CPPUNIT_ASSERT(pXmlDoc);
+
+    assertXPath(pXmlDoc, 
"/root/page/body/txt[2]/SwParaPortion/SwLineLayout[1]/SwFieldPortion"_ostr,
+                "expand"_ostr, "One");
+
+    // Without the fix in place, this test would have failed with
+    // - Expected: two
+    // - Actual  :  two
+    assertXPath(pXmlDoc, 
"/root/page/body/txt[2]/SwParaPortion/SwLineLayout[2]/SwFieldPortion"_ostr,
+                "expand"_ostr, "two");
+}
+
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf142694)
 {
     createSwDoc("tdf142694-1.odt");

Reply via email to