[evolution/gnome-3-32] I#348 - Email addresses in composer reset after space deletion



commit cf7b617f040e6a05a4c6579041a0f2704fce929c
Author: Milan Crha <mcrha redhat com>
Date:   Wed Mar 13 13:43:03 2019 +0100

    I#348 - Email addresses in composer reset after space deletion
    
    Closes https://gitlab.gnome.org/GNOME/evolution/issues/348

 src/e-util/e-name-selector-entry.c | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)
---
diff --git a/src/e-util/e-name-selector-entry.c b/src/e-util/e-name-selector-entry.c
index 7e8f7d2100..b7db7be0b9 100644
--- a/src/e-util/e-name-selector-entry.c
+++ b/src/e-util/e-name-selector-entry.c
@@ -1691,7 +1691,7 @@ user_delete_text (ENameSelectorEntry *name_selector_entry,
        gunichar     str_context[2], str_b_context[2];
        gint         len;
        gint         i;
-       gboolean     del_space = FALSE, del_comma = FALSE;
+       gboolean     del_comma = FALSE;
 
        if (start_pos == end_pos)
                return;
@@ -1772,26 +1772,14 @@ user_delete_text (ENameSelectorEntry *name_selector_entry,
 
        /* Do the actual deletion */
 
-       if (end_pos == start_pos +1 && index_end == index_start) {
+       if (end_pos == start_pos +1 && index_end == index_start + 1) {
                /* We could be just deleting the empty text */
                gchar *c;
 
                /* Get the actual deleted text */
                c = gtk_editable_get_chars (GTK_EDITABLE (name_selector_entry), start_pos, start_pos + 1);
 
-               if ( c[0] == ' ') {
-                       /* If we are at the beginning or removing junk space, let us ignore it */
-                       del_space = TRUE;
-               }
-               g_free (c);
-       } else  if (end_pos == start_pos +1 && index_end == index_start + 1) {
-               /* We could be just deleting the empty text */
-               gchar *c;
-
-               /* Get the actual deleted text */
-               c = gtk_editable_get_chars (GTK_EDITABLE (name_selector_entry), start_pos, start_pos + 1);
-
-               if ( c[0] == ',' && !is_quoted_at (text, start_pos)) {
+               if (c && c[0] == ',' && !is_quoted_at (text, start_pos)) {
                        /* If we are at the beginning or removing junk space, let us ignore it */
                        del_comma = TRUE;
                }
@@ -1868,7 +1856,7 @@ user_delete_text (ENameSelectorEntry *name_selector_entry,
                /* If the entry was completely cleared, remove the initial destination too */
                remove_destination_by_index (name_selector_entry, 0);
                generate_attribute_list (name_selector_entry);
-       } else  if (!del_space) {
+       } else {
                modify_destination_at_position (name_selector_entry, start_pos);
        }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]