sw/qa/extras/rtfexport/data/redline-insdel.rtf | 11 ++++++++ sw/qa/extras/rtfexport/rtfexport4.cxx | 33 +++++++++++++++++++++++++ 2 files changed, 44 insertions(+)
New commits: commit d2c7b60ee9591e3d951950e7b230dc271d3483f2 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Mon Aug 12 20:43:41 2019 +0200 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Tue Aug 13 09:07:27 2019 +0200 RTF filter: add redline insert/delete testcase lcov points out these were not covered previously. Change-Id: I469fab797b2935b36c06eb8854061b81faf2dbcf Reviewed-on: https://gerrit.libreoffice.org/77372 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/qa/extras/rtfexport/data/redline-insdel.rtf b/sw/qa/extras/rtfexport/data/redline-insdel.rtf new file mode 100644 index 000000000000..d0f5d8d48cfa --- /dev/null +++ b/sw/qa/extras/rtfexport/data/redline-insdel.rtf @@ -0,0 +1,11 @@ +{\rtf1 +{\*\revtbl +{Unknown;} +{Test;} +} +\pard\plain +aaa +{\deleted\revauth1\revdttm1199059860 bbb} +{\revised\revauth1\revdttm1199059860 BBB} +ccc\par +} diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx index 6ed155ca807a..7d0f98096ac1 100644 --- a/sw/qa/extras/rtfexport/rtfexport4.cxx +++ b/sw/qa/extras/rtfexport/rtfexport4.cxx @@ -79,6 +79,39 @@ DECLARE_RTFEXPORT_TEST(testCjklist31, "cjklist31.rtf") CPPUNIT_ASSERT_EQUAL(style::NumberingType::DI_ZI_ZH, numFormat); } +DECLARE_RTFEXPORT_TEST(testRedlineInsdel, "redline-insdel.rtf") +{ + uno::Reference<text::XTextRange> xParagraph = getParagraph(1); + + uno::Reference<text::XTextRange> xRun = getRun(xParagraph, 1); + CPPUNIT_ASSERT_EQUAL(OUString("Text"), getProperty<OUString>(xRun, "TextPortionType")); + CPPUNIT_ASSERT_EQUAL(OUString("aaa"), xRun->getString()); + + xRun = getRun(xParagraph, 2); + CPPUNIT_ASSERT_EQUAL(OUString("Redline"), getProperty<OUString>(xRun, "TextPortionType")); + CPPUNIT_ASSERT_EQUAL(OUString("Delete"), getProperty<OUString>(xRun, "RedlineType")); + xRun = getRun(xParagraph, 3); + CPPUNIT_ASSERT_EQUAL(OUString("Text"), getProperty<OUString>(xRun, "TextPortionType")); + CPPUNIT_ASSERT_EQUAL(OUString("bbb"), xRun->getString()); + xRun = getRun(xParagraph, 4); + CPPUNIT_ASSERT_EQUAL(OUString("Redline"), getProperty<OUString>(xRun, "TextPortionType")); + CPPUNIT_ASSERT_EQUAL(OUString("Delete"), getProperty<OUString>(xRun, "RedlineType")); + + xRun = getRun(xParagraph, 5); + CPPUNIT_ASSERT_EQUAL(OUString("Redline"), getProperty<OUString>(xRun, "TextPortionType")); + CPPUNIT_ASSERT_EQUAL(OUString("Insert"), getProperty<OUString>(xRun, "RedlineType")); + xRun = getRun(xParagraph, 6); + CPPUNIT_ASSERT_EQUAL(OUString("Text"), getProperty<OUString>(xRun, "TextPortionType")); + CPPUNIT_ASSERT_EQUAL(OUString("BBB"), xRun->getString()); + xRun = getRun(xParagraph, 7); + CPPUNIT_ASSERT_EQUAL(OUString("Redline"), getProperty<OUString>(xRun, "TextPortionType")); + CPPUNIT_ASSERT_EQUAL(OUString("Insert"), getProperty<OUString>(xRun, "RedlineType")); + + xRun = getRun(xParagraph, 8); + CPPUNIT_ASSERT_EQUAL(OUString("Text"), getProperty<OUString>(xRun, "TextPortionType")); + CPPUNIT_ASSERT_EQUAL(OUString("ccc"), xRun->getString()); +} + DECLARE_RTFEXPORT_TEST(testParaAdjustDistribute, "para-adjust-distribute.rtf") { // Without the accompanying fix in place, this test would have failed with _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits