gtkhtml r8746 - trunk/gtkhtml



Author: mcrha
Date: Tue Feb 19 19:15:00 2008
New Revision: 8746
URL: http://svn.gnome.org/viewvc/gtkhtml?rev=8746&view=rev

Log:
2008-02-19  Milan Crha  <mcrha redhat com>

	** Fix for bug #391730

	* gtkhtml.c: (update_primary_selection):
	Process only if selection is allowed and take care of NULL as text.
	* gtkhtml.c: (focus), (cursor_move), (gtk_html_select_word),
	(gtk_html_select_line), (gtk_html_select_paragraph),
	(gtk_html_select_paragraph_extended), (gtk_html_select_all):
	Ensure update primary selection.



Modified:
   trunk/gtkhtml/ChangeLog
   trunk/gtkhtml/gtkhtml.c

Modified: trunk/gtkhtml/gtkhtml.c
==============================================================================
--- trunk/gtkhtml/gtkhtml.c	(original)
+++ trunk/gtkhtml/gtkhtml.c	Tue Feb 19 19:15:00 2008
@@ -2359,6 +2359,7 @@
 			html_engine_jump_to_object (e, obj, offset);
 		}
 
+		update_primary_selection (GTK_HTML (w));
 		g_signal_emit (GTK_HTML (w), signals [CURSOR_CHANGED], 0);
 
 		return TRUE;
@@ -4402,9 +4403,15 @@
 	g_return_if_fail (html != NULL);
 	g_return_if_fail (GTK_IS_HTML (html));
 
+	if (!html->allow_selection)
+		return;
+
 	clipboard = gtk_widget_get_clipboard (GTK_WIDGET (html), GDK_SELECTION_PRIMARY);
 
 	text = get_selection_string (html, &text_len, FALSE, TRUE, FALSE, FALSE);
+	if (!text)
+		return;
+
 	gtk_clipboard_set_text (clipboard, text, text_len);
 
 	g_free (text);
@@ -4605,6 +4612,7 @@
 		return;
 
 	if (skip == GTK_HTML_CURSOR_SKIP_NONE) {
+		update_primary_selection (html);
 		g_signal_emit (GTK_HTML (html), signals [CURSOR_CHANGED], 0);
 		return;
 	}
@@ -4701,6 +4709,7 @@
 	html->priv->update_styles = TRUE;
 	gtk_html_edit_make_cursor_visible (html);
 	html_engine_update_selection_active_state (html->engine, html->priv->event_time);
+	update_primary_selection (html);
 	g_signal_emit (GTK_HTML (html), signals [CURSOR_CHANGED], 0);
 }
 
@@ -5578,6 +5587,7 @@
 		html_engine_select_word (e);
 
 	html_engine_update_selection_active_state (html->engine, html->priv->event_time);
+	update_primary_selection (html);
 }
 
 void
@@ -5595,6 +5605,7 @@
 		html_engine_select_line (e);
 
 	html_engine_update_selection_active_state (html->engine, html->priv->event_time);
+	update_primary_selection (html);
 }
 
 void
@@ -5613,6 +5624,7 @@
 	   html_engine_select_paragraph (e); */
 
 	html_engine_update_selection_active_state (html->engine, html->priv->event_time);
+	update_primary_selection (html);
 }
 
 void
@@ -5631,6 +5643,7 @@
 	   html_engine_select_paragraph (e); */
 
 	html_engine_update_selection_active_state (html->engine, html->priv->event_time);
+	update_primary_selection (html);
 }
 
 void
@@ -5650,6 +5663,7 @@
 	}
 
 	html_engine_update_selection_active_state (html->engine, html->priv->event_time);
+	update_primary_selection (html);
 }
 
 void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]