summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2010-05-18 14:22:07 +0200
committerMichael Stahl <mst@openoffice.org>2010-05-18 14:22:07 +0200
commit7c95004d871363c93485aea4d63c816db0f270c6 (patch)
tree945fa2e199f5159704de4a1e4dda3b32494d2904 /sw
parent544a5b109986e0577ce0d007f9ecdd59ef6305db (diff)
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.
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/docredln.cxx19
-rw-r--r--sw/source/core/undo/undel.cxx10
-rw-r--r--sw/source/core/undo/undobj.cxx7
3 files changed, 28 insertions, 8 deletions
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index db13779ad4..8737f7d868 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 74c2c0854a..ce5181dfb6 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 0a16b89699..02156626ab 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 );
}