tdf#157628: sw_layoutwriter: Add unittest

Change-Id: I8d1a471d8edab9e789311a8a1d20bd21c0f47cef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162435
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/sw/qa/extras/layout/data/tdf157628.docx b/sw/qa/extras/layout/data/tdf157628.docx
new file mode 100644
index 0000000..2cf6398
--- /dev/null
+++ b/sw/qa/extras/layout/data/tdf157628.docx
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 0e7049d..95f5eb8 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -3692,6 +3692,19 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf159101)
                "expand"_ostr, "two");
}

CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf157628)
{
    createSwDoc("tdf157628.docx");

    xmlDocUniquePtr pXmlDoc = parseLayoutDump();
    CPPUNIT_ASSERT(pXmlDoc);

    assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[1]/SwLinePortion"_ostr,
                "portion"_ostr, "This is in first row");
    assertXPath(pXmlDoc, "/root/page/body/txt[1]/SwParaPortion/SwLineLayout[2]/SwLinePortion"_ostr,
                "portion"_ostr, "This is second row*");
}

CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf142694)
{
    createSwDoc("tdf142694-1.odt");