diff options
author | László Németh <nemeth@numbertext.org> | 2019-03-05 21:56:06 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2019-03-06 17:21:43 +0100 |
commit | df4f405a153603551f67e289bbaccf9ac39b923c (patch) | |
tree | 68be9d6e0af2cd635c5ae5425a46e207e943c62f /sw | |
parent | 8c0178870889a47c46fec8f59b7c94dcabf6d126 (diff) |
tdf#121176 DOCX track changes: same size w:del in w:ins
Instead of showing the tracked deletion as untracked
normal text, losing the original and actual text contents,
now w:del within a same size w:ins is imported as
tracked deletion correctly.
Change-Id: I7390df34f557664860a63779c5f972d5013ecc99
Reviewed-on: https://gerrit.libreoffice.org/68779
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf121176.docx | bin | 0 -> 30973 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentRedlineManager.cxx | 6 |
3 files changed, 11 insertions, 3 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf121176.docx b/sw/qa/extras/ooxmlexport/data/tdf121176.docx Binary files differnew file mode 100644 index 000000000000..f95c023b0565 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf121176.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 9b1dd0627cb0..a8306385e12c 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -959,7 +959,13 @@ DECLARE_OOXMLIMPORT_TEST(testTdf116084, "tdf116084.docx") CPPUNIT_ASSERT_EQUAL( OUString( "must" ), getRun( getParagraph( 1 ), 5 )->getString()); } - +DECLARE_OOXMLIMPORT_TEST(testTdf121176, "tdf121176.docx") +{ + // w:del is imported correctly when it is in a same size w:ins + CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 1 ), 1 )->getString()); + CPPUNIT_ASSERT(hasProperty(getRun(getParagraph(1), 1), "RedlineType")); + CPPUNIT_ASSERT_EQUAL( OUString( "must" ), getRun( getParagraph( 1 ), 2 )->getString()); +} CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index c7d473c29d3a..e55b04bd5279 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -1473,10 +1473,12 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall bCompress = true; } - if( !bCallDelete && *pEnd == *pREnd ) + if( !bCallDelete && !bDec && *pEnd == *pREnd ) pRedl->SetEnd( *pStt, pREnd ); - else + else if ( bCallDelete || !bDec ) { + // delete new redline, except in some cases of fallthrough from previous + // case ::Equal (eg. same portion w:del in w:ins in OOXML import) delete pNewRedl; pNewRedl = nullptr; } |