From: <rl...@us...> - 2006-10-24 03:37:52
|
Revision: 17573 http://svn.sourceforge.net/gaim/?rev=17573&view=rev Author: rlaager Date: 2006-10-23 20:37:46 -0700 (Mon, 23 Oct 2006) Log Message: ----------- Revert my previous change here, and re-fix the issue mentioned in SF Bug #1573887. Basically, I ended up special-casing u' so that u're and u'll will correct properly. This doesn't know the difference between U'LL and U'll, but I'm not terribly concerned about it. I think it'll be more coding than it's worth. If you really want me to fix that, speak up. Modified Paths: -------------- trunk/gtk/plugins/spellchk.c Modified: trunk/gtk/plugins/spellchk.c =================================================================== --- trunk/gtk/plugins/spellchk.c 2006-10-24 01:09:13 UTC (rev 17572) +++ trunk/gtk/plugins/spellchk.c 2006-10-24 03:37:46 UTC (rev 17573) @@ -298,6 +298,7 @@ g_free(spell); } +/* Pango doesn't know about the "'" character. Let's fix that. */ static gboolean spellchk_inside_word(GtkTextIter *iter) { @@ -326,8 +327,36 @@ if (gtk_text_iter_inside_word (iter) == TRUE) return TRUE; + if (c == '\'') { + gboolean result = gtk_text_iter_backward_char(iter); + gboolean output = gtk_text_iter_inside_word(iter); + + if (result) + { + /* + * Hack so that "u'll" will correct correctly. + */ + ucs4_char = gtk_text_iter_get_char(iter); + utf8_str = g_ucs4_to_utf8(&ucs4_char, 1, NULL, NULL, NULL); + if (utf8_str != NULL) + { + c = utf8_str[0]; + g_free(utf8_str); + + if (c == 'u' || c == 'U') + { + gtk_text_iter_forward_char(iter); + return FALSE; + } + } + + gtk_text_iter_forward_char(iter); + } + + return output; + } + return FALSE; - } static gboolean This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |