From 038d1a932ce339985c91b05c2be35d512f7cef71 Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Tue, 24 Apr 2001 02:51:45 +0000 Subject: Removed attempts to use Radek's evil hacks, which were just causing 2001-04-23 Jon Trowbridge * e-html-utils.c (e_text_to_html_full): Removed attempts to use Radek's evil hacks, which were just causing me (and GtkHTML) grief. 2001-04-23 Jon Trowbridge * gui/component/e-address-popup.c: Lots of code has been simplified here. (e_address_popup_factory_new_control): Rather than directly pop our control up in a window (via the e_address_popup_popup function, which is now gone), just return the widget and let the caller do the popping. This works better, since it means we don't have to work around the vagaries of bonobo focus & event handling. (e_address_popup_set_name): Refresh when both name & email have been set, rather than checking a stupid counter. (e_address_popup_set_email): Ditto. 2001-04-23 Jon Trowbridge * mail-display.c (html_button_press_event): Check for mailto: links, and pop up our mail address menu when we find one. (make_popup_window): The main piece of code (ignoring a zillion little callbacks) to pop up our windows with reasonable semantics for having them close automatically. (mail_text_write): Enable converting addresses to mailto links in message bodies. * mail-format.c (write_address): Simplify code, removing Radek's hacks. Write out addresses as mailto: links. svn path=/trunk/; revision=9534 --- e-util/e-html-utils.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'e-util/e-html-utils.c') diff --git a/e-util/e-html-utils.c b/e-util/e-html-utils.c index 4bcfc920b0..c9c116e754 100644 --- a/e-util/e-html-utils.c +++ b/e-util/e-html-utils.c @@ -65,12 +65,15 @@ url_extract (const unsigned char **text, gboolean check) return out; } -/* FIXME */ +/* FIXME -- this should be smarter */ static gboolean is_email_address (const unsigned char *c) { gboolean seen_at = FALSE, seen_postat = FALSE; + if (c == NULL) + return FALSE; + if (*c == '<') ++c; @@ -100,6 +103,9 @@ email_address_extract (const unsigned char **text) const unsigned char *end = *text; char *out; + if (end == NULL) + return NULL; + while (*end && !isspace (*end) && (*end != '>') && (*end < 0x80)) ++end; @@ -293,12 +299,8 @@ e_text_to_html_full (const char *input, unsigned int flags, guint32 color) dispaddr = e_text_to_html (addr, 0); if (addr) { - gchar *outaddr = g_strdup_printf ("" - "" - "%s" - " " - "", - addr, addr, dispaddr); + gchar *outaddr = g_strdup_printf ("%s", + addr, dispaddr); out = check_size (&buffer, &buffer_size, out, strlen(outaddr)); out += sprintf (out, "%s", outaddr); col += strlen (addr); -- cgit