[Libreoffice-commits] core.git: sw/qa sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Mar 6 16:22:12 UTC 2019
sw/qa/extras/ooxmlexport/data/tdf121176.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 8 +++++++-
sw/source/core/doc/DocumentRedlineManager.cxx | 6 ++++--
3 files changed, 11 insertions(+), 3 deletions(-)
New commits:
commit df4f405a153603551f67e289bbaccf9ac39b923c
Author: László Németh <nemeth at numbertext.org>
AuthorDate: Tue Mar 5 21:56:06 2019 +0100
Commit: László Németh <nemeth at numbertext.org>
CommitDate: Wed Mar 6 17:21:43 2019 +0100
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 at numbertext.org>
diff --git a/sw/qa/extras/ooxmlexport/data/tdf121176.docx b/sw/qa/extras/ooxmlexport/data/tdf121176.docx
new file mode 100644
index 000000000000..f95c023b0565
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf121176.docx differ
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;
}
More information about the Libreoffice-commits
mailing list