Opened 8 years ago
Closed 7 years ago
#14146 closed defect (fixed)
wxComboBox::SetString trashes associated data
Reported by: | aasselin | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 2.9.4 |
Component: | wxOSX | Version: | stable-latest |
Keywords: | client data loss, wxComboBox | Cc: | |
Blocked By: | Blocking: | ||
Patch: | yes |
Description
when calling mycombo->SetString(0, "hello") associated client data is lost, as well as type of client data if there is a single item in the combo
the implementation is using Delete(n); Insert(s,n); maybe it should be GetComboPeer()->RemoveItem(n); GetComboPeer()->InsertItem(n,s) ?
Attachments (1)
Change History (4)
Changed 8 years ago by aasselin
comment:1 Changed 7 years ago by vadz
- Milestone set to 2.9.4
comment:2 Changed 7 years ago by vadz
- Patch set
comment:3 Changed 7 years ago by VZ
- Resolution set to fixed
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.
This looks correct to me. I've also looked at NSComboBox to see if there was a way to replace the item directly, without removing and inserting it, but there doesn't seem to be any way to do it, so this patch is the best we can do.
Of course, as mentioned in #12419, we really ought to be using a data source with the combobox instead of mucking with its items anyhow, to be able to implement sorting in it. But this will have to wait :-(