Issue 31730 - Changing of "changes -> show" on and off deletes text
Summary: Changing of "changes -> show" on and off deletes text
Status: CLOSED FIXED
Alias: None
Product: *Testproduct
Classification: Test
Component: another (show other issues)
Version: current
Hardware: All All
: P2 Trivial (vote)
Target Milestone: OOo 2.0
Assignee: michael.ruess
QA Contact: issues@test
URL:
Keywords:
: 32787 (view as issue list)
Depends on:
Blocks:
 
Reported: 2004-07-19 16:07 UTC by ron.piterman
Modified: 2006-03-07 20:29 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
a simpler bugdoc (62.93 KB, application/octet-stream)
2004-10-05 14:26 UTC, openoffice
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description ron.piterman 2004-07-19 16:07:03 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.
Comment 1 Oliver Specht 2004-09-07 15:42:10 UTC
.
Comment 2 openoffice 2004-10-05 14:26:38 UTC
Created attachment 18138 [details]
a simpler bugdoc
Comment 3 openoffice 2004-10-05 14:38:31 UTC
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.
Comment 4 openoffice 2004-10-28 11:39:25 UTC
reopen for reassignment.
Comment 5 openoffice 2004-10-28 12:26:55 UTC
dvo->mru: please test.
Comment 6 openoffice 2004-10-28 12:29:07 UTC
reopen
Comment 7 openoffice 2004-10-28 12:29:57 UTC
reassign, try again.
Comment 8 michael.ruess 2004-11-03 14:02:57 UTC
Verified in CWS swqbugfixes08.
Comment 9 michael.ruess 2004-11-03 14:03:17 UTC
.
Comment 10 openoffice 2004-11-11 18:39:35 UTC
*** Issue 32787 has been marked as a duplicate of this issue. ***
Comment 11 michael.ruess 2005-01-06 13:51:35 UTC
Checked integration in 680m69.