Description: Most citation processors (Endnote, Zotero, Mendeley) insert fields into Word documents to store citation data. Libreoffice repesents these as Fieldmarks (com.sun.star.text.Fieldmark) and can create them just fine using UNO but not enumerate them. Steps to Reproduce: (see also https://stackoverflow.com/q/49728663/73299, https://ask.libreoffice.org/en/question/30175/how-access-fieldmarks-with-api/) 1. start libreoffice (libreoffice --writer --accept="socket,host=localhost,port=2002;urp;") 2. Create a text with a fieldmark: import uno from pythonscript import ScriptContext resolver = uno.getComponentContext().ServiceManager.createInstance('com.sun.star.bridge.UnoUrlResolver') # start libreoffice as # libreoffice --writer --accept="socket,host=localhost,port=2002;urp;"` client = resolver.resolve('uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext') XSCRIPTCONTEXT = ScriptContext(client, None, None) doc = XSCRIPTCONTEXT.getDocument() def cursor(): return doc.getCurrentController().getSelection().getByIndex(0) t = doc.getText() # insert text before field t.insertString(cursor(), 'Fieldmark-Start|', False) # create the field field = doc.createInstance('com.sun.star.text.Fieldmark') fieldcursor = cursor() # add the String 'Field contents' to the document fieldcursor.setString('Field contents') # actually insert the field in the document (linked to the string) field.attach(fieldcursor) field.setFieldType('Testfieldtype') field.setName('Fieldname') # insert text after the field t.insertString(cursor(), '|Fieldmark-End', False) 3. try to enumerate all text fields to get the inserted Fieldmark: XSCRIPTCONTEXT.getDocument().getTextFields() Actual Results: The returned enumeration has no elements Expected Results: An enumeration with one element: the just inserted Fieldmark Reproducible: Always User Profile Reset: No Additional Info: User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0
(In reply to Tristan Stenner from comment #0) > XSCRIPTCONTEXT.getDocument().getTextFields() I guess I could repro the bad result: pyuno object (com.sun.star.container.XEnumerationAccess)0x7fa538061728{implementationName=SwXTextFieldTypes, supportedServices={com.sun.star.text.TextFields}, supportedInterfaces={com.sun.star.container.XEnumerationAccess,com.sun.star.lang.XServiceInfo,com.sun.star.util.XRefreshable,com.sun.star.lang.XTypeProvider,com.sun.star.uno.XWeak}} Arch Linux 64-bit Version: 6.1.0.0.alpha0+ Build ID: de07f40030bbd604bc42d58f0e954cca284a2646 CPU threads: 8; OS: Linux 4.16; UI render: default; VCL: kde4; Locale: fi-FI (fi_FI.UTF-8); Calc: group Built on April 21st 2018
Dear Tristan Stenner, To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
Dear Tristan Stenner, To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug