diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-08-12 20:43:41 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-08-13 09:07:27 +0200 |
commit | d2c7b60ee9591e3d951950e7b230dc271d3483f2 (patch) | |
tree | bcc9c875497333c173562db5e3737c32b32c7420 | |
parent | f101853c7dd1e9104ccda96e61a624a0c1496f9a (diff) |
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 <vmiklos@collabora.com>
-rw-r--r-- | sw/qa/extras/rtfexport/data/redline-insdel.rtf | 11 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport4.cxx | 33 |
2 files changed, 44 insertions, 0 deletions
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 |