diff options
author | László Németh <nemeth@numbertext.org> | 2019-04-26 17:24:38 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2019-05-24 09:12:06 +0200 |
commit | 4f279b95efbc113d3c1907a232a4e647e2b4054f (patch) | |
tree | dbc48d7c1f20c3f7ddeac1c5d00ab49882509d5b /sw/qa | |
parent | 88158bb37d1e41fd192dc66db544daebc980df31 (diff) |
tdf#123460 DOCX track changes: moveFrom completely
also with the paragraph mark, not leaving an empty
paragraph at the original place of the moved text.
Note: as desktop version of MSO does, but its
online version leaves empty paragraphs interestingly.
Change-Id: I03dda8997df3efbc82e936bd31a3813323e6b5ab
Reviewed-on: https://gerrit.libreoffice.org/71382
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: László Németh <nemeth@numbertext.org>
(cherry picked from commit d32d9a2b3c5e3963f4a18f6c7bbf50fab2e9b2be)
Reviewed-on: https://gerrit.libreoffice.org/72718
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Tested-by: Jenkins
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf123460.docx | bin | 0 -> 13060 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 14 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport13.cxx | 20 |
3 files changed, 27 insertions, 7 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf123460.docx b/sw/qa/extras/ooxmlexport/data/tdf123460.docx Binary files differnew file mode 100644 index 000000000000..c3b723b4e5ad --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf123460.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 23958351a91b..018aa8ccfcb8 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -789,13 +789,13 @@ DECLARE_OOXMLIMPORT_TEST(testTdf104797, "tdf104797.docx") CPPUNIT_ASSERT_EQUAL(true,getProperty<bool>(getRun(getParagraph(1), 2), "IsStart")); CPPUNIT_ASSERT_EQUAL( OUString( "This is a filler sentence. Will this sentence be duplicated ADDED STUFF?" ), getParagraph( 2 )->getString()); - CPPUNIT_ASSERT_EQUAL( OUString( "This is a filler sentence." ), getRun( getParagraph( 2 ), 1 )->getString()); - CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 2 ), 2 )->getString()); - CPPUNIT_ASSERT_EQUAL( OUString( " Will this sentence be duplicated ADDED STUFF?" ), getRun( getParagraph( 2 ), 3 )->getString()); - CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 2 ), 4 )->getString()); - CPPUNIT_ASSERT(hasProperty(getRun(getParagraph(2), 5), "RedlineType")); - CPPUNIT_ASSERT_EQUAL(OUString("Insert"),getProperty<OUString>(getRun(getParagraph(2), 5), "RedlineType")); - CPPUNIT_ASSERT_EQUAL(false,getProperty<bool>(getRun(getParagraph(2), 5), "IsStart")); + CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 2 ), 1 )->getString()); + CPPUNIT_ASSERT_EQUAL( OUString( "This is a filler sentence." ), getRun( getParagraph( 2 ), 2 )->getString()); + CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 2 ), 3 )->getString()); + CPPUNIT_ASSERT(hasProperty(getRun(getParagraph(2), 3), "RedlineType")); + CPPUNIT_ASSERT_EQUAL(OUString("Insert"),getProperty<OUString>(getRun(getParagraph(2), 3), "RedlineType")); + CPPUNIT_ASSERT_EQUAL(true,getProperty<bool>(getRun(getParagraph(2), 3), "IsStart")); + CPPUNIT_ASSERT_EQUAL( OUString( " Will this sentence be duplicated ADDED STUFF?" ), getRun( getParagraph( 2 ), 4 )->getString()); } DECLARE_OOXMLEXPORT_TEST(testTdf113608_runAwayNumbering, "tdf113608_runAwayNumbering.docx") diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index e610254b3b83..ca211e0e7eb9 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -91,6 +91,26 @@ DECLARE_OOXMLEXPORT_TEST(testTextInput, "textinput.odt") assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[5]/w:t", "SomeText"); } +DECLARE_OOXMLIMPORT_TEST(testTdf123460, "tdf123460.docx") +{ + // check paragraph mark deletion at terminating moveFrom + CPPUNIT_ASSERT_EQUAL(true,getParagraph( 2 )->getString().startsWith("Nunc")); + CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 2 ), 1 )->getString()); + CPPUNIT_ASSERT(hasProperty(getRun(getParagraph(2), 1), "RedlineType")); + CPPUNIT_ASSERT_EQUAL(OUString("Delete"),getProperty<OUString>(getRun(getParagraph(2), 1), "RedlineType")); + CPPUNIT_ASSERT_EQUAL(true, getRun( getParagraph( 2 ), 2 )->getString().endsWith("tellus.")); + CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 2 ), 3 )->getString()); + bool bCaught = false; + try + { + getRun( getParagraph( 2 ), 4 ); + } + catch (container::NoSuchElementException&) + { + bCaught = true; + } + CPPUNIT_ASSERT_EQUAL(true, bCaught); +} CPPUNIT_PLUGIN_IMPLEMENT(); |