aboutsummaryrefslogtreecommitdiffstats
path: root/composer
diff options
context:
space:
mode:
authorRadek Doulik <rodo@src.gnome.org>2004-04-07 02:18:51 +0800
committerRadek Doulik <rodo@src.gnome.org>2004-04-07 02:18:51 +0800
commitc1cbf40e628c050248a87402f3e46f265a2fa31f (patch)
treeec381a8612e02b756335a16f122a174df57d9376 /composer
parente39f9922057619f529a6f1ec4ec06020bdfcbcc6 (diff)
downloadgsoc2013-evolution-c1cbf40e628c050248a87402f3e46f265a2fa31f.tar
gsoc2013-evolution-c1cbf40e628c050248a87402f3e46f265a2fa31f.tar.gz
gsoc2013-evolution-c1cbf40e628c050248a87402f3e46f265a2fa31f.tar.bz2
gsoc2013-evolution-c1cbf40e628c050248a87402f3e46f265a2fa31f.tar.lz
gsoc2013-evolution-c1cbf40e628c050248a87402f3e46f265a2fa31f.tar.xz
gsoc2013-evolution-c1cbf40e628c050248a87402f3e46f265a2fa31f.tar.zst
gsoc2013-evolution-c1cbf40e628c050248a87402f3e46f265a2fa31f.zip
(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) svn path=/trunk/; revision=25340
Diffstat (limited to 'composer')
-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 == "");
}
/**