From 43fccca05988fffa5a259b9e0847f9fa5d51f890 Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Wed, 30 Apr 2008 06:42:30 +0000 Subject: [PATCH] 2008-04-30 [colin] 3.4.0cvs17 * src/compose.c Fix 'Delete line' and 'Delete to end of line' on the last line. Patch by --- ChangeLog | 6 ++++++ PATCHSETS | 1 + configure.ac | 2 +- src/compose.c | 23 ++++++++++------------- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index bf1030e63..a00f3fbae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-04-30 [colin] 3.4.0cvs17 + + * src/compose.c + Fix 'Delete line' and 'Delete to end of line' + on the last line. Patch by + 2008-04-28 [colin] 3.4.0cvs16 * src/folder.c diff --git a/PATCHSETS b/PATCHSETS index 561ec1976..e8445487a 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -3312,3 +3312,4 @@ ( cvs diff -u -r 1.9.2.14 -r 1.9.2.15 src/addrindex.h; cvs diff -u -r 1.9.2.26 -r 1.9.2.27 src/common/ssl.c; cvs diff -u -r 1.4.2.26 -r 1.4.2.27 src/common/ssl_certificate.c; ) > 3.4.0cvs14.patchset ( cvs diff -u -r 1.9.2.27 -r 1.9.2.28 src/common/ssl.c; ) > 3.4.0cvs15.patchset ( cvs diff -u -r 1.213.2.181 -r 1.213.2.182 src/folder.c; cvs diff -u -r 1.36.2.137 -r 1.36.2.138 src/common/utils.c; ) > 3.4.0cvs16.patchset +( cvs diff -u -r 1.382.2.444 -r 1.382.2.445 src/compose.c; ) > 3.4.0cvs17.patchset diff --git a/configure.ac b/configure.ac index c610ba2ad..1ab7ca7bd 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=4 MICRO_VERSION=0 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=16 +EXTRA_VERSION=17 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/compose.c b/src/compose.c index 1194db075..d56748888 100644 --- a/src/compose.c +++ b/src/compose.c @@ -9590,7 +9590,6 @@ static void textview_delete_line (GtkTextView *text) GtkTextBuffer *buffer; GtkTextMark *mark; GtkTextIter ins, start_iter, end_iter; - gboolean found; g_return_if_fail(GTK_IS_TEXT_VIEW(text)); @@ -9602,13 +9601,13 @@ static void textview_delete_line (GtkTextView *text) gtk_text_iter_set_line_offset(&start_iter, 0); end_iter = ins; - if (gtk_text_iter_ends_line(&end_iter)) - found = gtk_text_iter_forward_char(&end_iter); - else - found = gtk_text_iter_forward_to_line_end(&end_iter); - - if (found) - gtk_text_buffer_delete(buffer, &start_iter, &end_iter); + if (gtk_text_iter_ends_line(&end_iter)){ + if (!gtk_text_iter_forward_char(&end_iter)) + gtk_text_iter_backward_char(&start_iter); + } + else + gtk_text_iter_forward_to_line_end(&end_iter); + gtk_text_buffer_delete(buffer, &start_iter, &end_iter); } static void textview_delete_to_line_end (GtkTextView *text) @@ -9616,7 +9615,6 @@ static void textview_delete_to_line_end (GtkTextView *text) GtkTextBuffer *buffer; GtkTextMark *mark; GtkTextIter ins, end_iter; - gboolean found; g_return_if_fail(GTK_IS_TEXT_VIEW(text)); @@ -9625,11 +9623,10 @@ static void textview_delete_to_line_end (GtkTextView *text) gtk_text_buffer_get_iter_at_mark(buffer, &ins, mark); end_iter = ins; if (gtk_text_iter_ends_line(&end_iter)) - found = gtk_text_iter_forward_char(&end_iter); + gtk_text_iter_forward_char(&end_iter); else - found = gtk_text_iter_forward_to_line_end(&end_iter); - if (found) - gtk_text_buffer_delete(buffer, &ins, &end_iter); + gtk_text_iter_forward_to_line_end(&end_iter); + gtk_text_buffer_delete(buffer, &ins, &end_iter); } static void compose_advanced_action_cb(Compose *compose, -- 2.25.1