tdf#125187 DOCX track changes: fix w:del within w:ins

by removing deletions within insertions, because
Writer core doesn't support overlapping redlines,
ie. tracked deletion as part of a tracked insertion.

Note: Commit 7a810d6a9fb79a24d00e5dbd8e1223e6f8b09677
handled this by breaking the tracked changes, fixing
"Accept All", but not the "Reject All".

Change-Id: Iad5932d97cd45bdd62c2df21abd4bcc0b4c3d9a1
Reviewed-on: https://gerrit.libreoffice.org/72128
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 42677b6..70b6e79 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -936,10 +936,7 @@ DECLARE_OOXMLIMPORT_TEST(testTdf116084, "tdf116084.docx")
    // tracked line is not a single text portion: w:del is recognized within w:ins
    CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 1 ), 1 )->getString());
    CPPUNIT_ASSERT(hasProperty(getRun(getParagraph(1), 1), "RedlineType"));
    CPPUNIT_ASSERT_EQUAL( OUString( "There " ), getRun( getParagraph( 1 ), 2 )->getString());
    CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 1 ), 4 )->getString());
    CPPUNIT_ASSERT(hasProperty(getRun(getParagraph(1), 4), "RedlineType"));
    CPPUNIT_ASSERT_EQUAL( OUString( "must" ), getRun( getParagraph( 1 ), 5 )->getString());
    CPPUNIT_ASSERT_EQUAL( OUString( "There should be a better start to this. " ), getRun( getParagraph( 1 ), 2 )->getString());
}

DECLARE_OOXMLIMPORT_TEST(testTdf121176, "tdf121176.docx")
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx
index 47d52d6..3056f8f 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -1471,7 +1471,10 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall
                                bCompress = true;
                            }
                            if( !bCallDelete && !bDec && *pEnd == *pREnd )
                                pRedl->SetEnd( *pStt, pREnd );
                            {
                                m_rDoc.getIDocumentContentOperations().DeleteAndJoin( *pNewRedl );
                                bCompress = true;
                            }
                            else if ( bCallDelete || !bDec )
                            {
                                // delete new redline, except in some cases of fallthrough from previous