Hi Paolo,

> In practice, having a listbox model, if you set the SelectedItems 
> property, on some ooo version the  itemStateChanged event of the ListBox 
> is raised.
> 
> The problem does not affect OOo vanilla version (sun build) but affects 
> the ooo packaged from Ubuntu.
> 
> you can test with the code below (you'll need to prepare a simple dialog 
> with a listbox before)
> 
> 
> Now, my question is:
> what is the correct behaviour:
> OOo by sun: the event is NOT raised if you modify the selection from the 
> model but it is raised if the user modify the selection manually.
> 
> OOo Ubuntu 9.10: the event is alwais raised
> 
> IMHO the first is correct or at least is the most used, because I have 
> never observed the second in old ooo versions.

Vanilla OOo is correct here. Control listeners are expected to be called
only when any user interaction is involved, or programmatic access to
the control (e.g. when you call ListBox.selectItem or some such).
Changes to the *control model* shall *not* trigger control listeners.

This rule has been settled quite some years ago, sad to see that
obviously the Ubuntu version adds some patches to OOo which violate this
rule.

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer         [email protected] -
- Sun Microsystems                      http://www.sun.com/staroffice -
- OpenOffice.org Base                       http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to