diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2007-04-28 18:04:00 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2007-04-28 18:04:00 +0000 |
commit | 0b4b5d5ee003652bca99643a642f03a68cc0bac5 (patch) | |
tree | c7a96d123eec8b99b9c5cd50135954d4dca95906 /gtk/gtkentry.c | |
parent | 08c05b1bcc716d36589890d22b2fe59f80ee4ece (diff) | |
download | gtk+-0b4b5d5ee003652bca99643a642f03a68cc0bac5.tar.gz |
Same fix for gtk_entry_real_insert_text
svn path=/trunk/; revision=17679
Diffstat (limited to 'gtk/gtkentry.c')
-rw-r--r-- | gtk/gtkentry.c | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 9935340785..f9744662ab 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -2432,7 +2432,6 @@ gtk_entry_real_insert_text (GtkEditable *editable, GtkEntry *entry = GTK_ENTRY (editable); gint index; gint n_chars; - guint password_hint_timeout; if (new_text_length < 0) new_text_length = strlen (new_text); @@ -2502,28 +2501,32 @@ gtk_entry_real_insert_text (GtkEditable *editable, if (entry->selection_bound > *position) entry->selection_bound += n_chars; - g_object_get (gtk_widget_get_settings (GTK_WIDGET (entry)), - "gtk-entry-password-hint-timeout", &password_hint_timeout, - NULL); - - if (password_hint_timeout > 0 && n_chars == 1 && !entry->visible && - (new_text_length < PASSWORD_HINT_MAX)) + if (n_chars == 1 && !entry->visible && (new_text_length < PASSWORD_HINT_MAX)) { - GtkEntryPasswordHint *password_hint = g_object_get_qdata (G_OBJECT (entry), - quark_password_hint); + guint password_hint_timeout; + + g_object_get (gtk_widget_get_settings (GTK_WIDGET (entry)), + "gtk-entry-password-hint-timeout", &password_hint_timeout, + NULL); - if (! password_hint) + if (password_hint_timeout > 0) { - password_hint = g_new0 (GtkEntryPasswordHint, 1); - g_object_set_qdata_full (G_OBJECT (entry), quark_password_hint, - password_hint, - (GDestroyNotify) gtk_entry_password_hint_free); - } + GtkEntryPasswordHint *password_hint = g_object_get_qdata (G_OBJECT (entry), + quark_password_hint); + + if (!password_hint) + { + password_hint = g_new0 (GtkEntryPasswordHint, 1); + g_object_set_qdata_full (G_OBJECT (entry), quark_password_hint, + password_hint, + (GDestroyNotify) gtk_entry_password_hint_free); + } - memset (&password_hint->password_hint, 0x0, PASSWORD_HINT_MAX); - password_hint->password_hint_length = new_text_length; - memcpy (&password_hint->password_hint, new_text, new_text_length); - password_hint->password_hint_position = *position + n_chars; + memset (&password_hint->password_hint, 0x0, PASSWORD_HINT_MAX); + password_hint->password_hint_length = new_text_length; + memcpy (&password_hint->password_hint, new_text, new_text_length); + password_hint->password_hint_position = *position + n_chars; + } } else { |