Apache OpenOffice (AOO) Bugzilla – Issue 31730
Changing of "changes -> show" on and off deletes text
Last modified: 2006-03-07 20:29:12 UTC
In a Spec (WebWizard), I set changes-record, changes->show. The I removed some text, ending with a graphic. Then I turned "changes -> show" off. Every time I change this on and off, some text, following the removed text was removed from the document. No "undo" was possible.
.
Created attachment 18138 [details] a simpler bugdoc
Added a bugdoc which allows for easier reproduction: With redlines enabled, delete from the beginning of the paragraph "design of step 5" (Page 4) to the end of the following paragraph (including the picture). (You can ignore the macros.) Then toggle redline visibility, and observe the text following the image. dvo->mru: The fix is 'deep down'. Please take the time to test various kinds of delete operations. Analysis: The problem was inside docedt.cxx#SwDoc::Delete(..). At one point, it uses absolute indices to compute which and how many nodes to delete. Between definition and use of the absolute index (nEnde), there is only one call to SwTextNode::Erase(..). The idea was apparently that this could not change the nodes array, since SwTextNode::Erase only changes the text node's text string. This is almost correct. Deleting the text will delete the text's attributes. When the text contains an anchored graphics the graphics will be deleted and, given the right combination of flags, the StartNode/GrfNode/EndNode triplet will be deleted from the the document. Which changes the nodes array. The fix is to not hold on to any absolute indices across such operations. Now, nEnde is only temporarily used in one operation and the if(..) clause guarding it.
reopen for reassignment.
dvo->mru: please test.
reopen
reassign, try again.
Verified in CWS swqbugfixes08.
*** Issue 32787 has been marked as a duplicate of this issue. ***
Checked integration in 680m69.