changeset 14807:3b5bfd634cc3

[gaim-migrate @ 17573] 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. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Tue, 24 Oct 2006 03:37:46 +0000
parents a2be9307d58d
children f87c99db8389
files gtk/plugins/spellchk.c
diffstat 1 files changed, 30 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/plugins/spellchk.c	Mon Oct 23 23:30:15 2006 +0000
+++ b/gtk/plugins/spellchk.c	Tue Oct 24 03:37:46 2006 +0000
@@ -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