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

            Bug ID: 92420
           Summary: Use of a specific field after dispose: not working
                    anymore (it used to work)
           Product: LibreOffice
           Version: 4.4.0.0.alpha0+ Master
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: minor
          Priority: medium
         Component: BASIC
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 116909
  --> https://bugs.documentfoundation.org/attachment.cgi?id=116909&action=edit
Basic example that works on LO 4.3 but not on 4.4

The behaviour of LibreOffice Basic changed in LO 4.4. The new behaviour might
make sense (I'm not a Basic expert) but some macros might rely on the previous
behavior.

Basically it can be summarized (see the attachment for a working example):

    Set oRange = oMark.Anchor

    ' If oMark.dispose is not called: it works on LO 4.4
    oMark.dispose

    ' Use oRange
    oRange.text.insertTextContent(oRange, oField, true)

In LO 4.3 oRange is valid (even if oMark got disposed) (does it use a reference
counter and avoids destroying oMark?).

In LO 4.4 oRange is not valid and the last line causes an exception:
BASIC runtime error.
An exception occurred 
Type: com.sun.star.lang.IllegalArgumentException
Message: first parameter invalid.

I'm not sure if this should have worked on LO 4.3 (and all the previous ones)
or was working due to a bug there.

We found it because a code like this exists in the Mendeley Desktop plugin:
https://github.com/Mendeley/openoffice-plugin/issues/16

Obviously I've simplified the code.

If this should not work I'll change MD code to avoid using the range of the
diposed mark (I might try to change our code anyway).

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

Reply via email to