GNOME Bugzilla – Bug 610537
autocomplete selection enters the wrong value, the next suggestion instead
Last modified: 2010-02-24 13:59:14 UTC
When an autocomplete value is displayed, and you press enter to select it, the wrong value is entered into the cell. It appears that the next autocomplete suggestion that would have been displayed is entered instead. To reproduce: New sheet Enter "Washington" in A1 Enter "Washington DC" in A2 Enter "Washington ST" in A3 Type "Wash" in A4, autocomplete suggests "Washington ST"; pressing Enter results in "Washington DC" in A4. Type "Washi" in A4, autocomplete suggests "Washington DC" and pressing Enter results in "Washington" in A4 Maybe some sort of "one off" bug.
I can replicate this.
As Morten suspected, this is not an issue of the wrong text being entered but of the wrong text being suggested. When I type "Was", workbook_edit_complete_notify is called fromthe idle handler and sets the completion text to "Washington ST" but it is not shown. When I add the "h" to "Wash", "Washington ST" is shown as completion and workbook_edit_complete_notify is called which sets the completion text to "Washington DC". SO the true problem is that the shown text is not what is currently stored as completion text.
In item-edit.c in item_edit_update_bounds the line text = wbcg_edit_get_display_text (scg_wbcg (ie->scg)); appears twice without a chance of any changes in between. I thin kthe second occurrence should be deleted. When workbook_edit_complete_notify is triggered this should cause item_class->update_bounds to be called.
Andreas, you are right, the second instance is of no use.
Created attachment 154568 [details] [review] proposed patch This patch fixes the sissue at hand by reloading the itemedit whenever our completion changes. The patch also deletes the unused line of code in item-edit.c.
The patch looks good for me.
Please go ahead with this.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.