changeset 25935:7942287364c2

The first thing gtk_text_buffer_delete_selection does is call gtk_text_buffer_get_selection_bounds and check if anything is selected, so we don't need to do it ourselves. Side note: gtk_text_buffer_delete_selection is exactly the same in gtk HEAD as it was in 2.0.0
author Mark Doliner <mark@kingant.net>
date Wed, 28 Jan 2009 08:31:47 +0000
parents 3461bf74cbf1
children 2cf7d6a20e68
files pidgin/gtkimhtml.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkimhtml.c	Wed Jan 28 07:12:43 2009 +0000
+++ b/pidgin/gtkimhtml.c	Wed Jan 28 08:31:47 2009 +0000
@@ -1125,8 +1125,8 @@
 	GtkTextIter iter;
 	GtkIMHtmlOptions flags = plaintext ? GTK_IMHTML_NO_SMILEY : (GTK_IMHTML_NO_NEWLINE | GTK_IMHTML_NO_COMMENTS);
 
-	if (gtk_text_buffer_get_selection_bounds(imhtml->text_buffer, NULL, NULL))
-		gtk_text_buffer_delete_selection(imhtml->text_buffer, TRUE, TRUE);
+	/* Delete any currently selected text */
+	gtk_text_buffer_delete_selection(imhtml->text_buffer, TRUE, TRUE);
 
 	gtk_text_buffer_get_iter_at_mark(imhtml->text_buffer, &iter, gtk_text_buffer_get_insert(imhtml->text_buffer));
 	if (!imhtml->wbfo && !plaintext)
@@ -4902,8 +4902,8 @@
 {
 	GtkTextIter iter;
 
-	if (gtk_text_buffer_get_selection_bounds(imhtml->text_buffer, NULL, NULL))
-		gtk_text_buffer_delete_selection(imhtml->text_buffer, TRUE, TRUE);
+	/* Delete any currently selected text */
+	gtk_text_buffer_delete_selection(imhtml->text_buffer, TRUE, TRUE);
 
 	gtk_imhtml_toggle_link(imhtml, url);
 	gtk_text_buffer_get_iter_at_mark(imhtml->text_buffer, &iter, mark);
@@ -4916,8 +4916,8 @@
 	GtkTextMark *mark;
 	GtkTextIter iter;
 
-	if (gtk_text_buffer_get_selection_bounds(imhtml->text_buffer, NULL, NULL))
-		gtk_text_buffer_delete_selection(imhtml->text_buffer, TRUE, TRUE);
+	/* Delete any currently selected text */
+	gtk_text_buffer_delete_selection(imhtml->text_buffer, TRUE, TRUE);
 
 	mark = gtk_text_buffer_get_insert(imhtml->text_buffer);