diff options
author | Not Zed <NotZed@Ximian.com> | 2004-02-02 13:05:07 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-02-02 13:05:07 +0800 |
commit | 38d71c0a1563222ac3cd21592e9cf67cfad928d5 (patch) | |
tree | d420a12b548e39d056e0e1d819ca2daa91f6de6e /composer/e-msg-composer.c | |
parent | 8e738775adc3e76b60ec07fae2d504efd9f1455a (diff) | |
download | gsoc2013-evolution-38d71c0a1563222ac3cd21592e9cf67cfad928d5.tar.gz gsoc2013-evolution-38d71c0a1563222ac3cd21592e9cf67cfad928d5.tar.zst gsoc2013-evolution-38d71c0a1563222ac3cd21592e9cf67cfad928d5.zip |
use g_ascii_strcasecmp rather than strcasecmp.
2004-02-02 Not Zed <NotZed@Ximian.com>
* evolution-composer.c (impl_Composer_set_body): use
g_ascii_strcasecmp rather than strcasecmp.
** See bug #53506, again.
* e-msg-composer.c (set_editor_text): Add an argument to make
adding the signature optional. Also fix a memleak with the sig
content.
(e_msg_composer_new_with_type, e_msg_composer_flush_pending_body)
(handle_mailto, e_msg_composer_set_body_text)
(e_msg_composer_set_body): Fixed callers for above change
appropriately.
svn path=/trunk/; revision=24562
Diffstat (limited to 'composer/e-msg-composer.c')
-rw-r--r-- | composer/e-msg-composer.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 487d8c608e..d6ea5bebdf 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -1077,14 +1077,15 @@ get_signature_html (EMsgComposer *composer) } static void -set_editor_text (EMsgComposer *composer, const char *text) +set_editor_text(EMsgComposer *composer, const char *text, int setsig) { Bonobo_PersistStream persist; BonoboStream *stream; BonoboWidget *editor; CORBA_Environment ev; Bonobo_Unknown object; - char *sig, *mem = NULL, *content; + char *sig, *mem = NULL; + const char *content; size_t len; g_return_if_fail (composer->persist_stream_interface != CORBA_OBJECT_NIL); @@ -1096,13 +1097,14 @@ set_editor_text (EMsgComposer *composer, const char *text) CORBA_exception_init (&ev); /* This copying bullshit is because the bonobo stream interface is just painful */ - sig = get_signature_html(composer); len = strlen(text); - if (sig) { + if (setsig + && (sig = get_signature_html(composer))) { len += strlen(sig); content = mem = g_malloc(len+1); memcpy(mem, text, strlen(text)); strcpy(mem + strlen(text), sig); + g_free(sig); } else { content = text; } @@ -3276,7 +3278,7 @@ e_msg_composer_new_with_type (int type) if (new) { e_msg_composer_set_send_html (new, send_html); set_editor_signature (new); - set_editor_text (new, ""); + set_editor_text (new, "", TRUE); } return new; @@ -3331,7 +3333,7 @@ e_msg_composer_flush_pending_body (EMsgComposer *composer, gboolean apply) body = g_object_get_data ((GObject *) composer, "body:text"); if (body) { if (apply) - set_editor_text (composer, body); + set_editor_text (composer, body, FALSE); g_object_set_data ((GObject *) composer, "body:text", NULL); g_free (body); @@ -4106,7 +4108,7 @@ handle_mailto (EMsgComposer *composer, const char *mailto) char *htmlbody; htmlbody = camel_text_to_html (body, CAMEL_MIME_FILTER_TOHTML_PRE, 0); - set_editor_text (composer, htmlbody); + set_editor_text (composer, htmlbody, FALSE); g_free (htmlbody); } } @@ -4199,7 +4201,7 @@ e_msg_composer_set_body_text (EMsgComposer *composer, const char *text) { g_return_if_fail (E_IS_MSG_COMPOSER (composer)); - set_editor_text (composer, text); + set_editor_text (composer, text, TRUE); } /** @@ -4217,9 +4219,7 @@ e_msg_composer_set_body (EMsgComposer *composer, const char *body, { g_return_if_fail (E_IS_MSG_COMPOSER (composer)); - set_editor_text (composer, _("<b>(The composer contains a non-text " - "message body, which cannot be " - "edited.)<b>")); + set_editor_text (composer, _("<b>(The composer contains a non-text message body, which cannot be edited.)<b>"), FALSE); e_msg_composer_set_send_html (composer, FALSE); disable_editor (composer); |