sw/qa/extras/ooxmlexport/data/tdf154478.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport18.cxx   |   16 ++++++++++++++++
 2 files changed, 16 insertions(+)

New commits:
commit 2711b42088ad8e19c2bccd265f032b4acaba7b9e
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Thu May 4 12:00:17 2023 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu May 4 17:27:26 2023 +0200

    tdf#154478: sw_ooxmlexport18: Add unittest
    
    Change-Id: I277d6fb8c1e9b8c46fed6bd07460513c11f089bc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151357
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf154478.docx 
b/sw/qa/extras/ooxmlexport/data/tdf154478.docx
new file mode 100644
index 000000000000..bfbfeda7687a
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf154478.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
index fc608f5cc6f2..c1682a130f80 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
@@ -151,6 +151,22 @@ DECLARE_OOXMLEXPORT_TEST(testTdf153042_noTab, 
"tdf153042_noTab.docx")
     assertXPath(pLayout, "//SwFixPortion", "width", "10");
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf154478)
+{
+    loadAndSave("tdf154478.docx");
+    xmlDocUniquePtr pXmlDoc = parseExport("word/comments.xml");
+
+    OUString aValues[5] = { "Comment1 seen.", "Comment2 seen.", "Comment3 
NOTseen.", "Comment4 NOTseen.", "Comment5 NOTseen." };
+    for (size_t i = 1; i < 6; ++i)
+    {
+        OString sPath = "/w:comments/w:comment[" + OString::number(i) + 
"]/w:p/w:r/w:t";
+
+        // Without the fix in place, this test would have failed with
+        // - In <>, XPath '/w:comments/w:comment[3]/w:p/w:r/w:t' not found
+        assertXPathContent(pXmlDoc, sPath, aValues[i - 1]);
+    }
+}
+
 CPPUNIT_TEST_FIXTURE(Test, testTdf153592_columnBreaks)
 {
     loadAndSave("tdf153592_columnBreaks.docx");

Reply via email to