ComboBox.ItemIndex reverts to previous value before TIniPropStorage saves its value.
Original Reporter info from Mantis: luca @olivluca
-
Reporter name: Luca Olivetti
Original Reporter info from Mantis: luca @olivluca
- Reporter name: Luca Olivetti
Description:
In the attached project there's a form with a combobox and an inipropstorage. The sessionproperties of the form are configured to save the ItemIndex of the ComboBox.
The problem is that between the invocation of the BotonAceptarClick method and the invocation of FormStorageSavingProperties the ItemIndex has reverted to the value it had when creating the form, unless I reference it in the BotonAceptarClick method.
Steps to reproduce:
- compile and run the attached project
- click on the "Test" button
- change the selection of the combobox
- click on the "Accept" button to save the value
- a message will show the value that's been saved, which is NOT the new one
- if you click "Test" again, the combobox shows the previous selection
If you unckeck the "Bug" checkbox, the ItemIndex is referenced in a ShowMessage within the BotonAceptarClick method and in this case the value is correctly saved.
Additional information:
I tested this both on win32 and on linux 64/gtk2.
I'm not sure the problem is in the LCL or in the RTL.
Mantis conversion info:
- Mantis ID: 28514
- Version: 1.4.2
- Fixed in revision: r49674 (#5747ff08)