[evolution-patches] Fix for bug#306986



Hi

I have attached the fix for bug#306986: Adding new word (enclosed in
single quotes) to dictionary does not work

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	19 Dec 2005 06:27:18 -0000
@@ -5767,6 +5767,18 @@ html_engine_clear_spell_check (HTMLEngin
 	html_engine_draw (e, e->x_offset, e->y_offset, e->width, e->height);
 }
 
+static void
+html_engine_strip_quote(gchar *word)
+{
+	if(word[0]=='\'' && word[strlen(word)-1]=='\'') {
+		int i;
+
+		for(i=1;i<strlen(word)-1;i++)
+			word[i-1]=word[i];
+		word[strlen(word)-2]='\0';
+ 	}
+}
+
 gchar *
 html_engine_get_spell_word (HTMLEngine *e)
 {
@@ -5776,12 +5788,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);
@@ -5808,11 +5819,10 @@ html_engine_get_spell_word (HTMLEngine *
 		html_cursor_forward (cursor, e);
 		cited2 = FALSE;
 	}
-
 	word = text->str;
 	g_string_free (text, FALSE);
 	html_cursor_destroy (cursor);
-
+	html_engine_strip_quote(word);
 	return word;
 }
 
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	19 Dec 2005 06:28:14 -0000
@@ -1,3 +1,10 @@
+2005-12-19  Rohini  <srohini novell com>
+
+	* htmlengine.c (html_engine_strip_quote): New Function 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]