From 2cbdc27d35f742c208fd7ce264ab9574fea4d824 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 14 Feb 2002 23:01:57 +0000 Subject: don't insert paragraph here, also delete paragraph where signature was 2002-02-14 Radek Doulik * e-msg-composer.c (delete_old_signature): don't insert paragraph here, also delete paragraph where signature was (e_msg_composer_show_sig_file): test if we are in empty document and if so, insert new paragraph for signature svn path=/trunk/; revision=15729 --- composer/ChangeLog | 7 +++++++ composer/e-msg-composer.c | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/composer/ChangeLog b/composer/ChangeLog index 37cb27afa9..f279adf966 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,10 @@ +2002-02-14 Radek Doulik + + * e-msg-composer.c (delete_old_signature): don't insert paragraph + here, also delete paragraph where signature was + (e_msg_composer_show_sig_file): test if we are in empty document + and if so, insert new paragraph for signature + 2002-02-12 Jeffrey Stedfast * e-msg-composer.c (e_msg_composer_flush_pending_body): Use diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 265538c872..e540f4579f 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -3416,8 +3416,8 @@ delete_old_signature (EMsgComposer *composer) /* if (!rv) break; */ GNOME_GtkHTML_Editor_Engine_setParagraphData (composer->editor_engine, "signature", "0", &ev); - } else - GNOME_GtkHTML_Editor_Engine_runCommand (composer->editor_engine, "insert-paragraph", &ev); + GNOME_GtkHTML_Editor_Engine_runCommand (composer->editor_engine, "delete-back", &ev); + } CORBA_exception_free (&ev); } @@ -3449,6 +3449,10 @@ e_msg_composer_show_sig_file (EMsgComposer *composer) if (html) { if (!GNOME_GtkHTML_Editor_Engine_isParagraphEmpty (composer->editor_engine, &ev)) GNOME_GtkHTML_Editor_Engine_runCommand (composer->editor_engine, "insert-paragraph", &ev); + if (!GNOME_GtkHTML_Editor_Engine_runCommand (composer->editor_engine, "cursor-backward", &ev)) + GNOME_GtkHTML_Editor_Engine_runCommand (composer->editor_engine, "insert-paragraph", &ev); + else + GNOME_GtkHTML_Editor_Engine_runCommand (composer->editor_engine, "cursor-forward", &ev); /* printf ("insert %s\n", html); */ GNOME_GtkHTML_Editor_Engine_setParagraphData (composer->editor_engine, "orig", "0", &ev); GNOME_GtkHTML_Editor_Engine_runCommand (composer->editor_engine, "indent-zero", &ev); -- cgit v1.2.3