Apache OpenOffice (AOO) Bugzilla – Issue 117995
Checkbox disappears when changing content of input text field
Last modified: 2014-04-14 19:13:04 UTC
Created attachment 76494 [details] document to reproduce the issue; contains macro When you change the content of an input text field through a macro or an extension using the UNO API, any checkboxes in the same document disappear (they are still there but not shown until you refresh the window). To easily reproduce the issue: 1. Open the attached document 'disappearing_checkbox.odt'. 2. Click on the button labelled "Change input field content". (This triggers a macro that changes the content of the input field contained in the document.) 3. The result is that the two checkboxes (including their labels) in the document disappear. The code of the macro used to change the input field is the following: vEnum = thisComponent.getTextFields().createEnumeration() If Not IsNull(vEnum) Then Do While vEnum.hasMoreElements() vVal = vEnum.nextElement() If vVal.supportsService("com.sun.star.text.TextField.Input") then vVal.setPropertyValue("Content", "Input field content changed!") vVal.update() End If Loop End If
confirming in oo 3.4beta
Developer's Guide says : The method update() of the interface com.sun.star.util.XUpdatable affects only the following field types: * Date and time fields are set to the current date and time. * The ExtendedUser fields that show parts of the user data set for OpenOffice.org, such as the Name, City, Phone No. and the Author fields that are set to the current values. * The FileName fields are updated with the current name of the file. * The DocInfo.XXX fields are updated with the current document info of the document. All other fields ignore calls to update(). _________________________________________ If, instead of update(), I do after the enumeration a global refresh of the textfields, no such problem. Sub Main2 Dim tf As Object, vEnum As Object, vVal As Object tf = ThisComponent.TextFields vEnum = tf.createEnumeration Do While vEnum.hasMoreElements vVal = vEnum.nextElement If vVal.supportsService("com.sun.star.text.textfield.Input") then vVal.Content = "Random number: " & int(rnd()*100)+1 end if Loop tf.refresh End Sub
I can confirm that the bug doesn't happen when you use a global refresh. Still, it's surely not intended that the call of update() makes the checkboxes disappear and maybe there's a deeper problem here.
I have reproduced the defect with OOo 3.1 and OOo 3.3
changed "3.4_release_blocker" flag to "-", no show stopper
getting rid of value "enhancement" for field "severity". For enhancement the field "issue type" shall be used.
Kyle B 11/07/13, I was able to reproduce this bug in Writer OpenOffice 4.0.1 (Build:9714)Rev 1524958 Windows 8.1. I found the checkboxes to re-appear if the region they are located in is highlighted. This bug does not occur if the checkboxes are highlighted when you click the button "Change input field content"
Was able to reproduce on OpenOffice version 4.01 Rev. 1524958. Thanks for the easy test file.
bmarcelly described how to do it without the update call and then it works as expected. I don't see any fix on this soon ...
Confirmed with AOO410m17(Build:9763) - Rev. 1586584 2014-04-11 09:13 - Linux x86_64 Debian