Description: Given the following test macro in python, False, not True is added to the text. _________________________________________ import uno def test(*arg): """This is a test macro.""" desktop = XSCRIPTCONTEXT.getDesktop() document = XSCRIPTCONTEXT.getDocument() model = desktop.getCurrentComponent() text = model.Text model.Text.End.String = f"{text.Start == text.Start}" _________________________________________ This is far from the only issue with the python interface/interface-documentation and I'd be very grateful a more general update, but this one is particularly bad. I'd guess the program is generating a new object on each request .getStart() probably and those objects have no way to compare to each other. Admittedly, I am on 7.3.7.2 release, so maybe I need to update. Steps to Reproduce: 1. sudo apt-get update -y 2. sudo apt-get install -y libreoffice-script-provider-python 3. cd /usr/lib/libreoffice/share/Scripts/python/ 4. sudo touch example.py 5. add code above to example.py 6. Open libreoffice, navigate to Tools>Macros>organize macros> python 7. Run test 8. observe incorrect result. Actual Results: False is added to end of document Expected Results: True should be added to end of document Reproducible: Always User Profile Reset: No Additional Info: Compared the internal values, probably some sort of document position value, and determined if those values equaled then respond according to that.
first: Don't do 3. 4. 5. in daily practise! never!! store youre python-code to: ~/.config/libreoffice/4/user/Scripts/python/… youre »asking« twice for »text.Start« so there are 2 pointing to the same, you may avoid it by: ___________________ def test(*arg): """ This is a test macro. keep sure you have some writer.odt in focus """ document = XSCRIPTCONTEXT.getDocument() text_object = document.Text.Start document.Text.End.String = f"{text_object is text_object}" __________________ Also note that object equality is checked with "is" and not with the "==" operator, and that you do not have to obtain the reference to the currently open document in focus in two different ways! I would say: Not a Bug!