[evolution-patches] gtkhtml #42275: dragging multiple images to the editor - fix



Attached patch fixes "dragging multiple images to the editor" bug

http://bugzilla.ximian.com/show_bug.cgi?id=42275

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
retrieving revision 1.1791
diff -u -p -r1.1791 ChangeLog
--- ChangeLog	6 May 2003 11:04:57 -0000	1.1791
+++ ChangeLog	6 May 2003 12:56:18 -0000
@@ -1,3 +1,12 @@
+2003-05-06  Radek Doulik  <rodo ximian com>
+
+	* gtkhtml.c (drag_data_received): call move_before_paste only
+	before first paste
+	(drag_data_received): call gtk_drag_finish everytime with success
+	set appropriately
+	(drag_data_received): fix the len parameter in call to
+	html_engine_paste_object
+
 2003-05-02  Radek Doulik  <rodo ximian com>
 
 	* htmlsearch.h: make start_pos and end_pos signed
Index: gtkhtml.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/gtkhtml.c,v
retrieving revision 1.507
diff -u -p -r1.507 gtkhtml.c
--- gtkhtml.c	6 May 2003 11:03:16 -0000	1.507
+++ gtkhtml.c	6 May 2003 12:56:22 -0000
@@ -2307,6 +2307,7 @@ drag_data_received (GtkWidget *widget, G
 		    gint x, gint y, GtkSelectionData *selection_data, guint info, guint time)
 {
 	HTMLEngine *engine = GTK_HTML (widget)->engine;
+	gboolean pasted = FALSE;
 
 	/* printf ("drag data received at %d,%d\n", x, y); */
 
@@ -2321,6 +2322,7 @@ drag_data_received (GtkWidget *widget, G
 	case DND_TARGET_TYPE_STRING:
 		/* printf ("\ttext/plain\n"); */
 		html_engine_paste_text (engine, selection_data->data, -1);
+		pasted = TRUE;
 		break;
 	case DND_TARGET_TYPE_TEXT_URI_LIST:
 	case DND_TARGET_TYPE__NETSCAPE_URL: {
@@ -2332,19 +2334,17 @@ drag_data_received (GtkWidget *widget, G
 		list_len = selection_data->length;
 		do {
 			uri = next_uri (&selection_data->data, &len, &list_len);
-			move_before_paste (widget, x, y);
 			obj = new_obj_from_uri (engine, uri, len);
-			if (obj)
-				html_engine_paste_object (engine, obj, len);
-			else {
-				gtk_drag_finish (context, FALSE, FALSE, time);
-				break;
+			if (obj) {
+				html_engine_paste_object (engine, obj, html_object_get_length (obj));
+				pasted = TRUE;
 			}
 		} while (list_len);
 		html_undo_level_end (engine->undo);
 	}
 	break;
 	}
+	gtk_drag_finish (context, pasted, FALSE, time);
 }
 
 /* dnd end */


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