gtkhtml r8690 - trunk/gtkhtml



Author: mcrha
Date: Wed Jan 16 09:54:16 2008
New Revision: 8690
URL: http://svn.gnome.org/viewvc/gtkhtml?rev=8690&view=rev

Log:
2008-01-16  Milan Crha  <mcrha redhat com>

	** Fix for bug #431190

	* htmliframe.c: (find_anchor), (html_iframe_class_init):
	* htmlframe.c: (find_anchor), (html_frame_class_init):
	Look for anchors in FRAME and IFRAME too.



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

Modified: trunk/gtkhtml/htmlframe.c
==============================================================================
--- trunk/gtkhtml/htmlframe.c	(original)
+++ trunk/gtkhtml/htmlframe.c	Wed Jan 16 09:54:16 2008
@@ -377,6 +377,29 @@
 	HTML_OBJECT_CLASS (parent_class)->destroy (o);
 }
 
+static HTMLAnchor *
+find_anchor (HTMLObject *self, const char *name, gint *x, gint *y)
+{
+	HTMLFrame *frame;
+	HTMLAnchor *anchor;
+
+	g_return_val_if_fail (HTML_IS_FRAME (self), NULL);
+
+	frame = HTML_FRAME (self);
+
+	if (!frame || !frame->html || !GTK_IS_HTML (frame->html) || !GTK_HTML (frame->html)->engine || !GTK_HTML (frame->html)->engine->clue)
+		return NULL;
+
+	anchor = html_object_find_anchor (GTK_HTML (frame->html)->engine->clue, name, x, y);
+
+	if (anchor) {
+		*x += self->x;
+		*y += self->y - self->ascent;
+	}
+
+	return anchor;
+}
+
 void
 html_frame_set_margin_width (HTMLFrame *frame, gint margin_width)
 {
@@ -570,6 +593,7 @@
 	object_class->is_container            = is_container;
 	object_class->append_selection_string = append_selection_string;
 	object_class->select_range            = select_range;
+	object_class->find_anchor             = find_anchor;
 
 	embedded_class->reparent = reparent;
 }

Modified: trunk/gtkhtml/htmliframe.c
==============================================================================
--- trunk/gtkhtml/htmliframe.c	(original)
+++ trunk/gtkhtml/htmliframe.c	Wed Jan 16 09:54:16 2008
@@ -273,6 +273,29 @@
 	return dup;
 }
 
+static HTMLAnchor *
+find_anchor (HTMLObject *self, const char *name, gint *x, gint *y)
+{
+	HTMLIFrame *iframe;
+	HTMLAnchor *anchor;
+
+	g_return_val_if_fail (HTML_IS_IFRAME (self), NULL);
+
+	iframe = HTML_IFRAME (self);
+
+	if (!iframe || !iframe->html || !GTK_IS_HTML (iframe->html) || !GTK_HTML (iframe->html)->engine || !GTK_HTML (iframe->html)->engine->clue)
+		return NULL;
+
+	anchor = html_object_find_anchor (GTK_HTML (iframe->html)->engine->clue, name, x, y);
+
+	if (anchor) {
+		*x += self->x;
+		*y += self->y - self->ascent;
+	}
+
+	return anchor;
+}
+
 void
 html_iframe_set_margin_width (HTMLIFrame *iframe, gint margin_width)
 {
@@ -706,6 +729,7 @@
 	object_class->check_point             = check_point;
 	object_class->is_container            = is_container;
 	object_class->append_selection_string = append_selection_string;
+	object_class->find_anchor             = find_anchor;
 
 	embedded_class->reparent = reparent;
 }



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