Issue 103681

Summary: different results when editing bookmark content after save + reload of document
Product: Writer Reporter: Daniel Benkmann <shenmux09>
Component: editingAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues
Version: OOo 3.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description Daniel Benkmann 2009-07-21 08:45:18 UTC
Sorry, the description to reproduce this problem is a bit lengthy because I
can't just attach an example document since the problem lies exactly in the fact
that the document behaves differently after having been saved and loaded again.

Steps to reproduce:
1. Open a new writer document
2. Enter the text "abcdef"
3. Select "abc" and insert a new bookmark on the selection (using
Insert->Bookmark), name the bookmark "bookmark1"
4. Select "def" and insert a new bookmark on the selection (using
Insert->Bookmark), name the bookmark "bookmark2"
5. Open the navigator (F5) and in it click on "bookmark1". The text "abc" should
now be selected.
6. Hit the Del-Key thus deleting "abc" (but not bookmark1)
7. Save the document (but don't close the document or reload it!)

Now execute the following macro which changes the contents of bookmark1 to "xyz":

Sub Main
  bookmark1 = ThisComponent.getBookmarks().getByName("bookmark1")
  bookmark1.getAnchor().setString("xyz")
End Sub

The document now contains the text "xyzdef". "xyz" is inside of bookmark1, "def"
is inside of bookmark2. This is the expected behaviour.

Now (without saving) close the document and open it again (or just use
File->Reload).
Execute the same macro as above. Since the document should be in the same state
as above the results should be the same, right? Well, no. After executing the
macro the document now only contains the text "xyz" which now lies inside of
bookmark1 as well as bookmark2. "def" was deleted.


The problem seems to be (described in pseudo-XML) that after step 7 the state of
the bookmarks is:
<bookmark1></bookmark1><bookmark2>def</bookmark2>
But after reloading the document the state is:
<bookmark2><bookmark1>def</bookmark2></bookmark1>
Comment 1 michael.ruess 2009-07-21 09:27:56 UTC
MRU->OS: I can imagine, that this is highly related to issue 103669. Quite
similar things happen in managing start/end of bookmaks while changing the text
in it.
Comment 2 Marcus 2017-05-20 11:15:57 UTC
Reset assigne to the default "issues@openoffice.apache.org".