After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 610537 - autocomplete selection enters the wrong value, the next suggestion instead
autocomplete selection enters the wrong value, the next suggestion instead
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: General
1.10.x
Other Linux
: Normal minor
: ---
Assigned To: Andreas J. Guelzow
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2010-02-20 14:46 UTC by Marlon Nelson
Modified: 2010-02-24 13:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (1.75 KB, patch)
2010-02-24 05:29 UTC, Andreas J. Guelzow
none Details | Review

Description Marlon Nelson 2010-02-20 14:46:54 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.
Comment 1 Andreas J. Guelzow 2010-02-21 06:33:52 UTC
I can replicate this.
Comment 2 Andreas J. Guelzow 2010-02-23 20:37:55 UTC
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.
Comment 3 Andreas J. Guelzow 2010-02-23 20:49:56 UTC
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.
Comment 4 Jean Bréfort 2010-02-23 21:46:50 UTC
Andreas, you are right, the second instance is of no use.
Comment 5 Andreas J. Guelzow 2010-02-24 05:29:29 UTC
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.
Comment 6 Jean Bréfort 2010-02-24 07:20:37 UTC
The patch looks good for me.
Comment 7 Morten Welinder 2010-02-24 13:53:20 UTC
Please go ahead with this.
Comment 8 Andreas J. Guelzow 2010-02-24 13:59:14 UTC
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.