Commits

Anonymous committed fbfb75b

sw34bf04: #o11831122#: prevent redline corruption:
SwDoc::DelFullPara: call other CorrAbs variant in case of single paragraph.
SwDoc::CorrAbs: delete empty redlines, which cause assertions.

Comments (0)

Files changed (2)

sw/source/core/doc/doccorr.cxx

     getIDocumentMarkAccess()->correctMarksAbsolute(rOldNode, rNewPos, nOffset);
     {   // fix redlines
         SwRedlineTbl& rTbl = *pRedlineTbl;
-        for( sal_uInt16 n = 0; n < rTbl.Count(); ++n )
+        for (sal_uInt16 n = 0; n < rTbl.Count(); )
         {
             // is on position ??
-            lcl_PaMCorrAbs(*rTbl[ n ], *aPam.Start(), *aPam.End(), aNewPos);
+            SwRedline *const pRedline( rTbl[ n ] );
+            bool const bChanged =
+                lcl_PaMCorrAbs(*pRedline, *aPam.Start(), *aPam.End(), aNewPos);
+            // clean up empty redlines: docredln.cxx asserts these as invalid
+            if (bChanged && (*pRedline->GetPoint() == *pRedline->GetMark())
+                         && (pRedline->GetContentIdx() == NULL))
+            {
+                rTbl.DeleteAndDestroy(n);
+            }
+            else
+            {
+                ++n;
+            }
         }
     }
 

sw/source/core/doc/docedt.cxx

 				return sal_False;
 			}
 		}
-			// text::Bookmarks usw. verschieben
-		CorrAbs( aRg.aStart, aRg.aEnd, *rPam.GetPoint(), sal_True );
+        // move bookmarks, redlines etc.
+        if (aRg.aStart == aRg.aEnd) // only first CorrAbs variant handles this
+        {
+            CorrAbs( aRg.aStart, *rPam.GetPoint(), 0, sal_True );
+        }
+        else
+        {
+            CorrAbs( aRg.aStart, aRg.aEnd, *rPam.GetPoint(), sal_True );
+        }
 
 			// was ist mit Fly's ??
 		{
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.