[evolution-patches] Fix for bug#306986 [gtkhtml]



Hi

Fix for bug#306986: Adding new word (enclosed in single quotes) to
dictionary does not work

Please review

Thanks,
Rohini
Index: htmlengine.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmlengine.c,v
retrieving revision 1.639
diff -u -p -r1.639 htmlengine.c
--- htmlengine.c	11 Sep 2005 04:05:25 -0000	1.639
+++ htmlengine.c	20 Dec 2005 10:45:08 -0000
@@ -5776,12 +5776,11 @@ html_engine_get_spell_word (HTMLEngine *
 	gint pos;
 	gunichar uc;
 	gboolean cited, cited_tmp, cited2;
-
 	cited = FALSE;
 	if (!html_selection_spell_word (html_cursor_get_current_char (e->cursor), &cited) && !cited
 	    && !html_selection_spell_word (html_cursor_get_prev_char (e->cursor), &cited) && !cited)
 		return NULL;
-
 	cursor = html_cursor_dup (e->cursor);
 	pos    = cursor->position;
 	text   = g_string_new (NULL);
@@ -5807,6 +5806,14 @@ html_engine_get_spell_word (HTMLEngine *
 		text = g_string_append (text, out);
 		html_cursor_forward (cursor, e);
 		cited2 = FALSE;
	}
+
+	/* remove ' at both ends of word*/
+	if (text->str[0] == '\'' && text->str[text->len - 1] == '\'') {
+		text->str[0]=text->str[text->len-1]=' ';
+		text->str=g_strchomp (text->str);
+		text->str=g_strchug (text->str);
+		text->len-=2;
+ 	}
 
 	word = text->str;
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
retrieving revision 1.2151
diff -u -p -r1.2151 ChangeLog
--- ChangeLog	22 Oct 2005 10:25:26 -0000	1.2151
+++ ChangeLog	20 Dec 2005 10:45:17 -0000
@@ -1,3 +1,10 @@
+2005-12-19  Rohini  <srohini novell com>
+
+	* htmlengine.c (html_engine_spell_word): Function modified to
+	strip single quote. 
+
+	Fixes bug #306986
+
 2005-10-22  Kaushal Kumar  <kakumar novell com>
 
 	* htmlprinter.c (draw_border): Do not draw peripheral border since


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