Created attachment 116909 [details] 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).
Hi Carles, thanks for reporting and the clear example. Testing on Ubuntu 32 bits here. In 4.4.4.3 and 4.3.7.2 I see the same behaviour and result in both versions. First there is a field, then it is replaced by a bookmark. Is this what is expected (I would say yes .. ;) ) ? It makes no difference for me to remark oMark.dispose..
When I tested I used "Version: 4.4.3.2" and previous versions of 4.4 (I just re-tested again). I'll test now using 4.4.4.3 and report again.
I've confirmed that the problem doesn't happen on 4.4.4.3 (it happens on 4.4.3.2) - so I guess that this cuold be closed. Thanks for having a look!
Thanks for your additional test and reporting back. I close as WorksForMe, since we have no idea what possibly fixed it. Ciao, Cor
Migrating Whiteboard tags to Keywords: (bibisectRequest) [NinjaEdit]