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



Bug 306986 – Adding new word (enclosed in single quotes) to dictionary
does not work

Made suggested changes

1. use of gstring functions
2. modified to add strings beginning with, ending with and enclosed in
single quote

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	22 Dec 2005 06:16:26 -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=g_string_erase(text,0,1);
+	}
+	if(text->str[text->len -1] == '\'') {
+		text=g_string_erase(text,text->len -1,1);
+ 	}
 
 	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	22 Dec 2005 06:16:43 -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]