[evolution-patches] gtkhtml: tabs in PRE flows fix



Attached patch fixes tabs in PRE flows.

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
retrieving revision 1.1787
diff -u -p -r1.1787 ChangeLog
--- ChangeLog	1 May 2003 16:41:22 -0000	1.1787
+++ ChangeLog	1 May 2003 17:02:16 -0000
@@ -1,3 +1,9 @@
+2003-05-01  Radek Doulik  <rodo ximian com>
+
+	* htmltext.c (calc_preferred_width): fix width calculation for
+	TABS, it fixes the min_width calculation of PRE flows as PRE flows
+	calculate theirs min width from child preffered width
+
 2003-04-30  Larry Ewing  <lewing ximian com>
 
 	* htmlengine.c (html_engine_draw_real): clip the bounds with
Index: htmltext.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmltext.c,v
retrieving revision 1.199
diff -u -p -r1.199 htmltext.c
--- htmltext.c	1 May 2003 16:41:23 -0000	1.199
+++ htmltext.c	1 May 2003 17:02:16 -0000
@@ -722,12 +722,23 @@ calc_preferred_width (HTMLObject *self,
 		      HTMLPainter *painter)
 {
 	HTMLText *text;
+	gint width;
 
 	text = HTML_TEXT (self);
 
 	html_text_request_word_width (text, painter);
 
-	return MAX (1, text->word_width [text->words - 1]);
+	width = text->word_width [text->words - 1];
+	if (html_clueflow_tabs (HTML_CLUEFLOW (self->parent), painter)) {
+		gint line_offset;
+		gint tabs;
+
+		line_offset = html_text_get_line_offset (text, painter);
+		width += (html_text_text_line_length (text->text, &line_offset, text->text_len, &tabs) - text->text_len)*
+			html_painter_get_space_width (painter, html_text_get_font_style (text), text->face);
+	}
+
+	return MAX (1, width);
 }
 
 static void


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