[evolution-patches] more gtkhtml fixes.



Two more small fixes for gtkhtml, Zucchi found the table one.

--Larry
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
retrieving revision 1.1810
diff -u -p -r1.1810 ChangeLog
--- ChangeLog	11 Jun 2003 17:34:00 -0000	1.1810
+++ ChangeLog	12 Jun 2003 15:24:19 -0000
@@ -1,3 +1,9 @@
+2003-06-12  Larry Ewing  <lewing ximian com>
+
+	* gtkhtml.c (destroy): free base_url.
+
+	* htmltable.c (destroy): free columnFixed array.
+
 2003-06-10  Larry Ewing  <lewing ximian com>
 
 	* gtkhtml.c (style_set): free the var_name.
Index: gtkhtml.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/gtkhtml.c,v
retrieving revision 1.515
diff -u -p -r1.515 gtkhtml.c
--- gtkhtml.c	11 Jun 2003 17:34:02 -0000	1.515
+++ gtkhtml.c	12 Jun 2003 15:24:22 -0000
@@ -706,6 +706,7 @@ destroy (GtkObject *object)
 		}
 
 		g_free (html->priv->content_type);
+		g_free (html->priv->base_url);
 		g_free (html->priv);
 		html->priv = NULL;
 	}
Index: htmlimage.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmlimage.c,v
retrieving revision 1.187
diff -u -p -r1.187 htmlimage.c
--- htmlimage.c	21 May 2003 15:21:22 -0000	1.187
+++ htmlimage.c	12 Jun 2003 15:24:23 -0000
@@ -72,7 +72,7 @@ static HTMLImagePointer   *html_image_po
 static void                html_image_pointer_ref               (HTMLImagePointer *ip);
 static void                html_image_pointer_unref             (HTMLImagePointer *ip);
 static gboolean            html_image_pointer_timeout           (HTMLImagePointer *ip);
-static gint                html_image_pointer_run_animation     (HTMLImagePointer *ip);
+static gint                html_image_pointer_update            (HTMLImagePointer *ip);
 static void                html_image_pointer_start_animation   (HTMLImagePointer *ip);
 
 static GdkPixbuf *         html_image_factory_get_missing       (HTMLImageFactory *factory);
@@ -495,8 +495,8 @@ html_image_resolve_image_url (GtkHTML *h
 
 		if (oarg) {
 			if (G_VALUE_TYPE (oarg) == G_TYPE_STRING)
-				url = (gchar *) g_strdup (g_value_get_string (oarg));
-			g_value_unset (oarg);	
+				url = (gchar *) g_value_get_string (oarg);
+			g_value_unset (iarg);	
 			g_free (oarg);
 		}
 		g_value_unset (iarg);
@@ -982,8 +982,7 @@ html_image_factory_types (GtkHTMLStream 
 }
 
 static void
-update_or_redraw (HTMLImagePointer *ip)
-{
+update_or_redraw (HTMLImagePointer *ip){
 	GSList *list;
 	gboolean update = FALSE;
 
@@ -1069,37 +1068,19 @@ html_image_factory_write_pixbuf (GtkHTML
 }
 
 static void
-html_image_factory_area_updated (GdkPixbufLoader *loader, guint x, guint y, guint width, guint height)
-{
-
-}
-
-static void
-html_image_factory_area_prepared (GdkPixbufLoader *loader, HTMLImagePointer *ip)
-{
-	if (!ip->animation) {
-		ip->animation = gdk_pixbuf_loader_get_animation (loader);
-		g_object_ref (ip->animation);
-		
-		html_image_pointer_start_animation (ip);
-	}
-	update_or_redraw (ip);
-}
-
-static void
 html_image_pointer_queue_animation (HTMLImagePointer *ip)
 {
 	gint delay = gdk_pixbuf_animation_iter_get_delay_time (ip->iter);
 
 	if (delay >= 0 && !ip->animation_timeout && ip->factory && ip->factory->animate) {
 		ip->animation_timeout = g_timeout_add (delay, 
-						       (GtkFunction) html_image_pointer_run_animation, 
+						       (GtkFunction) html_image_pointer_update, 
 						       (gpointer) ip);
 	}	
 }
 
 static gint
-html_image_pointer_run_animation (HTMLImagePointer *ip)
+html_image_pointer_update (HTMLImagePointer *ip)
 {
 	GdkPixbufAnimationIter  *iter = ip->iter;
 	HTMLEngine              *engine = ip->factory->engine;
@@ -1108,7 +1089,9 @@ html_image_pointer_run_animation (HTMLIm
 	ip->animation_timeout = 0;
 
 	/* printf ("animation_timeout\n"); */
-	if (gdk_pixbuf_animation_iter_advance (iter, NULL)) {
+	if (!iter 
+	    //	    || gdk_pixbuf_animation_iter_on_currently_loading_frame (iter)
+	    || gdk_pixbuf_animation_iter_advance (iter, NULL)) {
 		GSList *cur;
 
 		for (cur = ip->interests; cur; cur = cur->next) {
@@ -1121,7 +1104,7 @@ html_image_pointer_run_animation (HTMLIm
 		}
 	}
 		
-	html_image_pointer_queue_animation (ip);
+	html_image_pointer_start_animation (ip);
 	return FALSE;
 }
 
@@ -1143,6 +1126,26 @@ html_image_pointer_stop_animation (HTMLI
 		g_source_remove (ip->animation_timeout);
 		ip->animation_timeout = 0;
 	}
+}
+
+static void
+html_image_factory_area_updated (GdkPixbufLoader *loader, guint x, guint y, guint width, guint height, HTMLImagePointer *ip)
+{
+	html_image_pointer_stop_animation (ip);
+	/* run will requeue */
+	html_image_pointer_update (ip);
+}
+
+static void
+html_image_factory_area_prepared (GdkPixbufLoader *loader, HTMLImagePointer *ip)
+{
+	if (!ip->animation) {
+		ip->animation = gdk_pixbuf_loader_get_animation (loader);
+		g_object_ref (ip->animation);
+		
+		html_image_pointer_start_animation (ip);
+	}
+	update_or_redraw (ip);
 }
 
 static GdkPixbuf *
Index: htmltable.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmltable.c,v
retrieving revision 1.167
diff -u -p -r1.167 htmltable.c
--- htmltable.c	16 Jan 2003 20:16:05 -0000	1.167
+++ htmltable.c	12 Jun 2003 15:24:25 -0000
@@ -103,6 +103,7 @@ destroy (HTMLObject *o)
 	g_array_free (table->columnMin, TRUE);
 	g_array_free (table->columnPref, TRUE);
 	g_array_free (table->columnOpt, TRUE);
+	g_array_free (table->columnFixed, TRUE);
 	g_array_free (table->rowHeights, TRUE);
 
 	if (table->bgColor)


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