https://bugs.documentfoundation.org/show_bug.cgi?id=90816

            Bug ID: 90816
           Summary: setString() on the text range of a bookmark looses
                    bookmark
           Product: LibreOffice
           Version: Inherited From OOo
          Hardware: Other
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Writer
          Assignee: libreoffice-bugs@lists.freedesktop.org
          Reporter: chrl...@googlemail.com

Created attachment 115038
  --> https://bugs.documentfoundation.org/attachment.cgi?id=115038&action=edit
example document with macro --> can be used for reproducing the problem

In current LO 4.4 version and in master I noticed that calling setString on the
text range of a bookmark looses the bookmark. This did not happen until at
least LibreOffice 4.1.6 - so the behaviour has incompatibly changed somewhere
inbetween --> regression! The bookmark must be kept if its text content is
changed.

This code shows, what I mean:

Sub Main
  bm = ThisComponent.Bookmarks.getByName("bookmark")
  range = bm.Anchor.Text.createTextCursorByRange(bm.Anchor)
  range.setString("now, there is no more bookmark :-(")
End Sub

Here is how to reproduce:

Open the attached document "setStringOnBookmarkLoosesBookmarkExample.odt"
(enable macro-execution) and follow the instructions in the document.

The practical meaning:

Munich's WollMux (www.wollmux.net) heavily uses Bookmarks as DocumentCommands.
This bug direclty affects WollMux which can no longer be run with these LO
versions.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to