Issue 117995 - Checkbox disappears when changing content of input text field
Summary: Checkbox disappears when changing content of input text field
Status: CONFIRMED
Alias: None
Product: Writer
Classification: Application
Component: programming (show other issues)
Version: OOo 3.3
Hardware: PC All
: P3 Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-10 11:19 UTC by Daniel Benkmann
Modified: 2014-04-14 19:13 UTC (History)
9 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.1.0-dev
Developer Difficulty: ---
jsc: 3.4_release_blocker-


Attachments
document to reproduce the issue; contains macro (12.50 KB, application/vnd.oasis.opendocument.text)
2011-05-10 11:19 UTC, Daniel Benkmann
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Daniel Benkmann 2011-05-10 11:19:05 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
Comment 1 Oliver Brinzing 2011-05-10 12:58:38 UTC
confirming in oo 3.4beta
Comment 2 bmarcelly 2011-05-10 17:14:11 UTC
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
Comment 3 Daniel Benkmann 2011-05-12 07:13:07 UTC
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.
Comment 4 Oliver-Rainer Wittmann 2012-03-02 12:36:12 UTC
I have reproduced the defect with OOo 3.1 and OOo 3.3
Comment 5 jsc 2012-03-02 12:49:34 UTC
changed "3.4_release_blocker" flag to "-", no show stopper
Comment 6 Oliver-Rainer Wittmann 2012-06-13 12:17:33 UTC
getting rid of value "enhancement" for field "severity".
For enhancement the field "issue type" shall be used.
Comment 7 Kyle 2013-11-07 19:58:55 UTC
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"
Comment 8 Douglas Lenz 2013-11-11 19:55:33 UTC
Was able to reproduce on OpenOffice version 4.01 Rev. 1524958. Thanks for the easy test file.
Comment 9 jsc 2013-11-15 12:18:18 UTC
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 ...
Comment 10 Edwin Sharp 2014-04-14 19:13:04 UTC
Confirmed with
AOO410m17(Build:9763)  -  Rev. 1586584
2014-04-11 09:13 - Linux x86_64
Debian