Apache OpenOffice (AOO) Bugzilla – Issue 103669
Calling setString twice on bookmark's text range deletes adjacent bookmark
Last modified: 2017-05-20 11:15:29 UTC
The writer document setStringDeletesBookmark.odt (attached below) contains two bookmarks. One called 'bookmark1' on the text "abc", the other called 'bookmark2' behind "abc". This is how it looks in the content.xml: <text:bookmark-start text:name="bookmark1"/>abc<text:bookmark-end text:name="bookmark1"/><text:bookmark text:name="bookmark2"/> Calling the setString() function twice on bookmark1's text range deletes bookmark2. This can be tested by executing the following macro (also included in the document): Sub Main bookmark1 = ThisComponent.getBookmarks().getByName("bookmark1") range = bookmark1.getAnchor() range.setString("foo") range.setString("bar") 'Now bookmark2 is deleted! End Sub
Created attachment 63654 [details] test document containing two bookmarks
Reassigned
MRU->OS: setString deletes the bookmark at the end of the text. On the first execution of setString, the bookmark moves to the beginning of the text, the second one deletes it completely. I have also noticed that something like this happens when doing this manually without a macro.
Reset assigne to the default "issues@openoffice.apache.org".