aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer/ChangeLog3
-rw-r--r--composer/e-msg-composer.c13
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 <BR> (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, "<br>");
+ if (pad_signature)
+ p = g_stpcpy (p, "<br>");
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 == "");
}
/**