| Summary: | Combo's removeAll why call postEvent? | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Levente Farkas <lfarkas> |
| Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | ericwill |
| Version: | 4.2 | Keywords: | triaged |
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
Is there a bug here, or is this just a question about implementation details? we assume it's a bug that's way i wrote this entry. (In reply to Levente Farkas from comment #2) > we assume it's a bug that's way i wrote this entry. Okay. I looked into the code, and I can't see anything explaining why it's set up that way. Do you have a snippet that reproduces the bug which this causes? this is our old test code: https://pastebin.com/6vwP471U (In reply to Levente Farkas from comment #4) > this is our old test code: > https://pastebin.com/6vwP471U Thanks for the snippet. This is the output I get when running it: ADD: Central 1 (40/40) after Central 1 (40/40) ADD: Central 2 (40/40) after Central 2 (40/40) Central 1 (40/40) ADD: Central 10 (40/40) after Central 2 (40/40) Central 10 (40/40) Central 1 (40/40) ADD: Central 3 (40/40) after Central 3 (40/40) Central 2 (40/40) Central 10 (40/40) Central 1 (40/40) ADD: Central 11 (40/40) after Central 3 (40/40) Central 2 (40/40) Central 11 (40/40) Central 10 (40/40) Central 1 (40/40) ADD: Central 4 (40/40) after Central 4 (40/40) Central 3 (40/40) Central 2 (40/40) Central 11 (40/40) Central 10 (40/40) Central 1 (40/40) ADD: Central 12 (40/40) after Central 4 (40/40) Central 3 (40/40) Central 2 (40/40) Central 12 (40/40) Central 11 (40/40) Central 10 (40/40) Central 1 (40/40) What exactly is the bug? in the current swt it's working. it a bug report from 2012 |
Build Identifier: 3.6.1-6.13.el6.x86_64 in Combo's removeAll call clearText which is : ---------------------------------- void clearText () { OS.g_signal_handlers_block_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); if ((style & SWT.READ_ONLY) != 0) { int index = OS.gtk_combo_box_get_active (handle); if (index != -1) { int /*long*/ modelHandle = OS.gtk_combo_box_get_model (handle); int /*long*/ [] ptr = new int /*long*/ [1]; int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); OS.gtk_tree_model_iter_nth_child (modelHandle, iter, 0, index); OS.gtk_tree_model_get (modelHandle, iter, 0, ptr, -1); OS.g_free (iter); if (ptr [0] != 0 && OS.strlen (ptr [0]) > 0) postEvent (SWT.Modify); OS.g_free (ptr [0]); } } else { OS.gtk_entry_set_text (entryHandle, new byte[1]); } OS.gtk_combo_box_set_active (handle, -1); OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); } ---------------------------------- why it's called postEvent and why just in case of SWT.READ_ONLY case? it doesn't make any sence if called from removeAll. Reproducible: Always