From c1cbf40e628c050248a87402f3e46f265a2fa31f Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 6 Apr 2004 18:18:51 +0000 Subject: (set_editor_text): added pad_signature parameter to tell if we want to pad signature with
(used when creating new mail, in other cases we don't want to pad the signature) svn path=/trunk/; revision=25340 --- composer/ChangeLog | 3 +++ composer/e-msg-composer.c | 13 +++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/composer/ChangeLog b/composer/ChangeLog index 8826ad1798..4ba66a6577 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -2,6 +2,9 @@ * e-msg-composer.c (prepare_signatures_menu): added empty hbox so that we have 12pxs between account setting and signature setting + (set_editor_text): added pad_signature parameter to tell if we + want to pad signature with
(used when creating new mail, in + other cases we don't want to pad the signature) Fixes #42866 diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index b8a304fd8b..38b9de7dc8 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -1081,7 +1081,7 @@ get_signature_html (EMsgComposer *composer) } static void -set_editor_text(EMsgComposer *composer, const char *text, int setsig) +set_editor_text(EMsgComposer *composer, const char *text, int set_signature, int pad_signature) { Bonobo_PersistStream persist; BonoboStream *stream; @@ -1102,13 +1102,14 @@ set_editor_text(EMsgComposer *composer, const char *text, int setsig) /* This copying bullshit is because the bonobo stream interface is just painful */ len = strlen(text); - if (setsig && (sig = get_signature_html (composer))) { + if (set_signature && (sig = get_signature_html (composer))) { char *p; len += strlen (sig); - content = mem = g_malloc (len + 5); + content = mem = g_malloc (len + (pad_signature ? 4 : 0) + 1); p = g_stpcpy (mem, text); - p = g_stpcpy (p, "
"); + if (pad_signature) + p = g_stpcpy (p, "
"); strcpy (p, sig); g_free (sig); } else { @@ -3358,7 +3359,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, "", TRUE); + set_editor_text (new, "", TRUE, TRUE); } return new; @@ -4273,7 +4274,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, TRUE); + set_editor_text (composer, text, TRUE, text == ""); } /** -- cgit