2005-02-27 [colin] 1.0.1cvs19.3
authorColin Leroy <colin@colino.net>
Sun, 27 Feb 2005 09:45:04 +0000 (09:45 +0000)
committerColin Leroy <colin@colino.net>
Sun, 27 Feb 2005 09:45:04 +0000 (09:45 +0000)
* src/compose.c
Don't auto-join the signature separator.

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/compose.c

index 167a3a438d968b192bb5ef4d5cd6d141b2b92bb8..c0c1546f29693e178b79c8ba5f0ff9eef2cf7e29 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-27 [colin]     1.0.1cvs19.3
+
+       * src/compose.c
+               Don't auto-join the signature separator.
+
 2005-02-26 [colin]     1.0.1cvs19.2
 
        * src/summaryview.c
index bc4b6c755e3caf14f2ea488847794412a19dc45e..ec964418b579fb7113e27b25d41667e513d2e381 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.17.2.11 -r 1.17.2.12 src/alertpanel.c; cvs diff -u -r 1.65.2.24 -r 1.65.2.25 src/codeconv.c; cvs diff -u -r 1.382.2.107 -r 1.382.2.108 src/compose.c; cvs diff -u -r 1.96.2.48 -r 1.96.2.49 src/textview.c; cvs diff -u -r 1.5.2.9 -r 1.5.2.10 src/gtk/gtkutils.c; cvs diff -u -r 1.4.2.7 -r 1.4.2.8 src/gtk/gtkutils.h; cvs diff -u -r 1.1.4.7 -r 1.1.4.8 src/gtk/logwindow.c; cvs diff -u -r 1.1.4.7 -r 1.1.4.8 src/gtk/progressdialog.c; ) > 1.0.1cvs15.12.patchset
 ( cvs diff -u -r 1.2504.2.49 -r 1.2504.2.50 ChangeLog.claws; cvs diff -u -r 1.654.2.437 -r 1.654.2.438 configure.ac; cvs diff -u -r 1.105.2.17 -r 1.105.2.18 src/prefs_account.c; cvs diff -u -r 1.52.2.9 -r 1.52.2.10 src/prefs_folder_item.c; cvs diff -u -r 1.12.2.16 -r 1.12.2.17 src/gtk/prefswindow.c; cvs diff -u -r 1.7.2.2 -r 1.7.2.3 src/gtk/prefswindow.h; ) > 1.0.1cvs19.1.patchset
 ( cvs diff -u -r 1.395.2.57 -r 1.395.2.58 src/summaryview.c; ) > 1.0.1cvs19.2.patchset
+( cvs diff -u -r 1.382.2.108 -r 1.382.2.109 src/compose.c; ) > 1.0.1cvs19.3.patchset
index 01bf80f2c9b0d9febd0cfc9eec76448d7265d5eb..63388720893d2e301eac5f980fe5842d5fbf6b19 100644 (file)
@@ -13,7 +13,7 @@ INTERFACE_AGE=0
 BINARY_AGE=0
 EXTRA_VERSION=19
 EXTRA_RELEASE=
-EXTRA_GTK2_VERSION=.2
+EXTRA_GTK2_VERSION=.3
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}${EXTRA_RELEASE}${EXTRA_GTK2_VERSION}
index edf81cfb9819987f94f99bfb031b9e93b685fe05..407e2caa6cda483fea5864eec8eac5b6514b24ff 100644 (file)
@@ -2633,27 +2633,29 @@ static gboolean compose_get_line_break_pos(GtkTextBuffer *buffer,
        return do_break;
 }
 
-static gboolean is_sig_separator(Compose *compose, GtkTextBuffer *textbuf, guint start_pos
+static gboolean is_sig_separator(Compose *compose, GtkTextBuffer *textbuf, GtkTextIter *iter
 {
        char *text = NULL;
-       GtkTextIter iter; 
+       GtkTextIter start = *iter;
        GtkTextIter end_iter;
+       int start_pos = gtk_text_iter_get_offset(&start);
+
        if (!compose->account->sig_sep)
                return FALSE;
        
-       gtk_text_buffer_get_iter_at_offset(textbuf, &iter, start_pos+1);
        gtk_text_buffer_get_iter_at_offset(textbuf, &end_iter,
-               start_pos+strlen(compose->account->sig_sep)+1);
+               start_pos+strlen(compose->account->sig_sep));
 
-       if (!strcmp(gtk_text_iter_get_text(&iter, &end_iter),
+       /* check sig separator */
+       if (!strcmp(gtk_text_iter_get_text(&start, &end_iter),
                        compose->account->sig_sep)) {
-               /* check \n */
-               gtk_text_buffer_get_iter_at_offset(textbuf, &iter,
-                       start_pos+strlen(compose->account->sig_sep)+1);
+               /* check end of line (\n) */
+               gtk_text_buffer_get_iter_at_offset(textbuf, &start,
+                       start_pos+strlen(compose->account->sig_sep));
                gtk_text_buffer_get_iter_at_offset(textbuf, &end_iter,
-                       start_pos+strlen(compose->account->sig_sep)+2);
+                       start_pos+strlen(compose->account->sig_sep)+1);
 
-               if (!strcmp(gtk_text_iter_get_text(&iter, &end_iter),"\n"));
+               if (!strcmp(gtk_text_iter_get_text(&start, &end_iter),"\n"));
                        return TRUE;
                
 
@@ -2662,7 +2664,8 @@ static gboolean is_sig_separator(Compose *compose, GtkTextBuffer *textbuf, guint
        return FALSE;
 }
 
-static gboolean compose_join_next_line(GtkTextBuffer *buffer,
+static gboolean compose_join_next_line(Compose *compose,
+                                      GtkTextBuffer *buffer,
                                       GtkTextIter *iter,
                                       const gchar *quote_str)
 {
@@ -2697,6 +2700,10 @@ static gboolean compose_join_next_line(GtkTextBuffer *buffer,
                gtk_text_buffer_delete(buffer, &iter_, &end);
        }
 
+       /* don't join if next line is sig separator */
+       if (is_sig_separator(compose, buffer, &iter_))
+               return FALSE;
+
        /* delete linebreak and extra spaces */
        prev = cur = iter_;
        while (gtk_text_iter_backward_char(&cur)) {
@@ -2713,6 +2720,7 @@ static gboolean compose_join_next_line(GtkTextBuffer *buffer,
                gtk_text_iter_forward_char(&cur);
                next = cur;
        }
+       
        if (!gtk_text_iter_equal(&prev, &next)) {
                GtkTextMark *mark;
 
@@ -2827,7 +2835,7 @@ static void compose_wrap_paragraph(Compose *compose, GtkTextIter *par_iter)
                                                       quote_str, -1);
 
                        iter = break_pos;
-                       compose_join_next_line(buffer, &iter, quote_str);
+                       compose_join_next_line(compose, buffer, &iter, quote_str);
 
                        /* move iter to current line start */
                        gtk_text_iter_set_line_offset(&iter, 0);