Index: src/ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
retrieving revision 1.2177
diff -u -p -r1.2177 ChangeLog
--- src/ChangeLog	26 Apr 2006 09:46:56 -0000	1.2177
+++ src/ChangeLog	24 May 2006 11:41:54 -0000
@@ -1,3 +1,13 @@
+2006-05-24  Hiroyuki Ikezoe  <poincare@ikezoe.net>
+
+	** Fixes bug #258374
+	* gtkhtml-private.h: (clipboard_string): new value for storing copying
+	text.
+	* gtkhtml.c: (gtk_html_init):  Initialize clipboard_string.
+	(destroy): Copying clipboard_string to clipboard if exists.
+	(gtk_html_cut): Set selected text to clipboard_string.
+	(gtk_html_copy): Ditto.
+
 2006-04-26  Li Yuan <li.yuan@sun.com>
 
 	* htmlobject.c: (move_object_downtree_cursor):
Index: src/gtkhtml-private.h
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/gtkhtml-private.h,v
retrieving revision 1.46
diff -u -p -r1.46 gtkhtml-private.h
--- src/gtkhtml-private.h	11 Sep 2005 04:05:25 -0000	1.46
+++ src/gtkhtml-private.h	24 May 2006 11:41:54 -0000
@@ -78,6 +78,8 @@ struct _GtkHTMLPrivate {
 	gboolean in_object_resize;
 	GdkCursor *resize_cursor;
 	HTMLObject *resize_object;
+
+	gchar      *clipboard_string;
 };
 
 void  gtk_html_private_calc_scrollbars  (GtkHTML                *html,
Index: src/gtkhtml.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/gtkhtml.c,v
retrieving revision 1.619
diff -u -p -r1.619 gtkhtml.c
--- src/gtkhtml.c	24 Apr 2006 06:36:37 -0000	1.619
+++ src/gtkhtml.c	24 May 2006 11:41:55 -0000
@@ -754,6 +754,15 @@ destroy (GtkObject *object)
 			html->priv->resize_cursor = NULL;
 		}
 
+		if (html->priv->clipboard_string) {
+			GtkClipboard *clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
+			gtk_clipboard_set_text (clipboard,
+						html->priv->clipboard_string,
+						strlen (html->priv->clipboard_string));
+			g_free (html->priv->clipboard_string);
+			html->priv->clipboard_string;
+		}
+
 		g_free (html->priv->content_type);
 		g_free (html->priv->base_url);
 		g_free (html->priv);
@@ -3403,6 +3412,8 @@ gtk_html_init (GtkHTML* html)
 		gconf_client_notify_add (gconf_client_get_default (), "/desktop/gnome/interface/monospace_font_name",
 					 client_notify_monospace_font, html, NULL, &gconf_error);
 
+	html->priv->clipboard_string = NULL;
+
 	gtk_html_construct (html);
 }
 
@@ -4264,9 +4275,14 @@ gtk_html_set_paragraph_alignment (GtkHTM
 void
 gtk_html_cut (GtkHTML *html)
 {
+	gint len;
 	g_return_if_fail (html != NULL);
 	g_return_if_fail (GTK_IS_HTML (html));
 
+	if (html->priv->clipboard_string)
+		g_free (html->priv->clipboard_string);
+	html->priv->clipboard_string = get_selection_string (html, &len, FALSE, FALSE, FALSE, FALSE);
+
 	html_engine_cut (html->engine);
 	gtk_selection_owner_set (GTK_WIDGET (html), gdk_atom_intern ("CLIPBOARD", FALSE), gtk_get_current_event_time ());
 }
@@ -4274,11 +4290,17 @@ gtk_html_cut (GtkHTML *html)
 void
 gtk_html_copy (GtkHTML *html)
 {
+	gint len;
+
 	g_return_if_fail (html != NULL);
 	g_return_if_fail (GTK_IS_HTML (html));
 
 	html_engine_copy (html->engine);
 	gtk_selection_owner_set (GTK_WIDGET (html), gdk_atom_intern ("CLIPBOARD", FALSE), gtk_get_current_event_time ());
+
+	if (html->priv->clipboard_string)
+		g_free (html->priv->clipboard_string);
+	html->priv->clipboard_string = get_selection_string (html, &len, FALSE, FALSE, FALSE, FALSE);
 }
 
 void
