sw33bf04: #i97421#: fix loop in AppendRedline:
SwUndoDelete::Redo(): recreate redline save data (based on patch by majun51).
SwDoc::AppendRedline(): fix loop on DELETE/INSERT without extent.
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 000da49..6d8ac96b9 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -914,17 +914,24 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
case POS_INSIDE:
{
pNewRedl->PushData( *pRedl, FALSE );
if( *pRStt == *pStt )
{
pRedl->SetStart( *pEnd, pRStt );
// neu einsortieren
pRedlineTbl->Remove( n );
pRedlineTbl->Insert( pRedl, n );
bDec = true;
// --> mst 2010-05-17 #i97421#
// redline w/out extent loops
if (*pStt != *pEnd)
// <--
{
pNewRedl->PushData( *pRedl, FALSE );
pRedl->SetStart( *pEnd, pRStt );
// re-insert
pRedlineTbl->Remove( n );
pRedlineTbl->Insert( pRedl, n );
bDec = true;
}
}
else
{
pNewRedl->PushData( *pRedl, FALSE );
if( *pREnd != *pEnd )
{
pNew = new SwRedline( *pRedl );
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index 593382f..b0860e3 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -863,7 +863,15 @@ void SwUndoDelete::Redo( SwUndoIter& rUndoIter )
SetPaM( rPam );
if( pRedlSaveData )
rDoc.DeleteRedline( rPam, false, USHRT_MAX );
{
bool bSuccess = FillSaveData(rPam, *pRedlSaveData, TRUE);
OSL_ENSURE(bSuccess,
"SwUndoDelete::Redo: used to have redline data, but now none?");
if (!bSuccess)
{
delete pRedlSaveData, pRedlSaveData = 0;
}
}
if( !bDelFullPara )
{
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 2c341cb..1a71a70 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -1120,7 +1120,12 @@ void SwRedlineSaveData::RedlineToDoc( SwPaM& rPam )
if (rDoc.GetDocShell() && (pRedl->GetComment() != String(::rtl::OUString::createFromAscii(""))) )
rDoc.GetDocShell()->Broadcast(SwRedlineHint(pRedl,SWREDLINE_INSERTED));
//
rDoc.AppendRedline( pRedl, true );
#if OSL_DEBUG_LEVEL > 0
bool const bSuccess =
#endif
rDoc.AppendRedline( pRedl, true );
OSL_ENSURE(bSuccess,
"SwRedlineSaveData::RedlineToDoc: insert redline failed");
rDoc.SetRedlineMode_intern( eOld );
}