gtkhtml r9095 - branches/gnome-2-24/gtkhtml



Author: mbarnes
Date: Mon Jan 12 04:23:50 2009
New Revision: 9095
URL: http://svn.gnome.org/viewvc/gtkhtml?rev=9095&view=rev

Log:
2009-01-11  Matthew Barnes  <mbarnes redhat com>

	** Fixes bug #565491

	* gtkhtml/htmlengine.c (insert_text):
	Preserve up to one leading space when parsing HTML.  Eliminates
	strange cut-and-paste behavior when the text segment has leading
	whitespace.



Modified:
   branches/gnome-2-24/gtkhtml/ChangeLog
   branches/gnome-2-24/gtkhtml/htmlengine.c

Modified: branches/gnome-2-24/gtkhtml/htmlengine.c
==============================================================================
--- branches/gnome-2-24/gtkhtml/htmlengine.c	(original)
+++ branches/gnome-2-24/gtkhtml/htmlengine.c	Mon Jan 12 04:23:50 2009
@@ -941,7 +941,14 @@
 	            if (' ' == (HTML_TEXT (prev)->text)[HTML_TEXT (prev)->text_bytes - 1])
 	                prev_text_ends_in_space = TRUE ;
 
-	if (e->flow == NULL || ((prev == NULL || prev_text_ends_in_space) && !e->inPre)) {
+	if (e->flow == NULL) {
+		/* Preserve one leading space. */
+		if (*text == ' ') {
+			while (*text == ' ')
+				text++;
+			text--;
+		}
+	} else if ((prev == NULL || prev_text_ends_in_space) && !e->inPre) {
 		while (*text == ' ')
 			text++;
 		if (*text == 0)



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