From 864046c7e4c1af311fd1b26bf6120f543e64c9a0 Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Mon, 9 Jul 2001 03:29:31 +0000 Subject: Check that str isn't the empty string before doing an insert. 2001-07-08 Jon Trowbridge * gui/component/select-names/e-select-names-text-model.c (e_select_names_text_model_insert_length): Check that str isn't the empty string before doing an insert. * backend/ebook/e-destination.c (e_destination_set_string): We were being too smart for our own good here, and causing problems for the completion code... (bug #4253, bug #4255, bug #4280) (e_destination_set_name): Clear any cached address. (e_destination_set_email): Clear any cached address. (e_destination_get_address): Handle the cases where the name contains some e-mail information. svn path=/trunk/; revision=10901 --- addressbook/gui/component/select-names/e-select-names-text-model.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'addressbook/gui') diff --git a/addressbook/gui/component/select-names/e-select-names-text-model.c b/addressbook/gui/component/select-names/e-select-names-text-model.c index 50a09bd010..0183fdd236 100644 --- a/addressbook/gui/component/select-names/e-select-names-text-model.c +++ b/addressbook/gui/component/select-names/e-select-names-text-model.c @@ -333,7 +333,7 @@ e_select_names_text_model_insert_length (ETextModel *model, gint pos, const gcha /* This is the case of hitting , first thing in an empty entry */ if (index == -1) { EReposAbsolute repos; - + e_select_names_model_insert (source, 0, e_destination_new ()); e_select_names_model_insert (source, 0, e_destination_new ()); @@ -361,7 +361,7 @@ e_select_names_text_model_insert_length (ETextModel *model, gint pos, const gcha repos.len = SEPLEN; e_text_model_reposition (model, e_repos_insert_shift, &repos); pos += SEPLEN; - } + } } else { EReposInsertShift repos; @@ -396,7 +396,7 @@ e_select_names_text_model_insert_length (ETextModel *model, gint pos, const gcha gboolean whitespace = isspace ((gint) text[i]); str = index >= 0 ? e_select_names_model_get_string (source, index) : NULL; - if (str) { + if (str && *str) { if (pos <= start_pos) { if (whitespace) { /* swallow leading whitespace */ -- cgit v1.2.3