(related: tdf#130685) sw: fix ~SwIndexReg asserts from ...

... lcl_DeleteRedlines(), if there are redlines immediately consecutive
that get deleted; merge the SwPaM ring in that case which should help.

Change-Id: I07b67413ad6ee52bc81b89facc40202d0ca75e2a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91595
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
(cherry picked from commit 27aa4b16bf704d0246595750daf57b57ff2577b3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91522
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index aeafeea..e677c60 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -382,6 +382,12 @@ namespace
                                lcl_SetCpyPos( *pREnd, *pStt, *pCpyStt,
                                                *pDelPam->GetPoint(), nDelCount );
                            }

                            if (pDelPam->GetNext() && *pDelPam->GetNext()->End() == *pDelPam->Start())
                            {
                                *pDelPam->GetNext()->End() = *pDelPam->End();
                                pDelPam.reset(pDelPam->GetNext());
                            }
                        }
                    }
                }