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

            Bug ID: 161843
           Summary: Python Macro Interface fails self-identity test.
           Product: LibreOffice
           Version: 7.3.7.2 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: [email protected]
          Reporter: [email protected]

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to