tdf#81750 new unit test: no duplication of field content

Change-Id: I53eeca0dfad9176935a70b98a19b2ce044969031
Reviewed-on: https://gerrit.libreoffice.org/66004
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
diff --git a/sw/qa/extras/mailmerge/data/tdf81750.odt b/sw/qa/extras/mailmerge/data/tdf81750.odt
new file mode 100644
index 0000000..830db24
--- /dev/null
+++ b/sw/qa/extras/mailmerge/data/tdf81750.odt
Binary files differ
diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx
index c614cc7..59cd2b5 100644
--- a/sw/qa/extras/mailmerge/mailmerge.cxx
+++ b/sw/qa/extras/mailmerge/mailmerge.cxx
@@ -1110,5 +1110,24 @@
    }
}

// problem was: field content was duplicated & truncated
DECLARE_SHELL_MAILMERGE_TEST(testTdf81750_shell, "tdf81750.odt", "10-testing-addresses.ods", "testing-addresses")
{
    // prepare unit test and run
    executeMailMerge();

    // reset currently opened layout of the original template,
    // and create the layout of the document with 10 mails inside
    dumpMMLayout();

    // check several pages page
    OUString aExpected("Text: Foo ");
    CPPUNIT_ASSERT_EQUAL( aExpected, parseDump("/root/page[1]/body/txt[2]", ""));
    CPPUNIT_ASSERT_EQUAL( aExpected, parseDump("/root/page[3]/body/txt[2]", ""));
    CPPUNIT_ASSERT_EQUAL( aExpected, parseDump("/root/page[5]/body/txt[2]", ""));
    CPPUNIT_ASSERT_EQUAL( aExpected, parseDump("/root/page[7]/body/txt[2]", ""));
    CPPUNIT_ASSERT_EQUAL( aExpected, parseDump("/root/page[9]/body/txt[2]", ""));
}

CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */