2009-07-09 [colin] 3.7.2cvs4
authorColin Leroy <colin@colino.net>
Thu, 9 Jul 2009 06:41:35 +0000 (06:41 +0000)
committerColin Leroy <colin@colino.net>
Thu, 9 Jul 2009 06:41:35 +0000 (06:41 +0000)
* src/gtk/spell_entry.c
Fix bug 1949, 'Spell checker doesn't recognise
certain word in Subject header, but does in
message body'. Patch by Pawel Pekala.

ChangeLog
PATCHSETS
configure.ac
src/gtk/spell_entry.c

index 27bef55c5c12a70d59e584c8d8c435d3c299e8c1..bf33607eb2b0c8575a806b9ad78ffe43975539e1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-07-09 [colin]     3.7.2cvs4
+
+       * src/gtk/spell_entry.c
+               Fix bug 1949, 'Spell checker doesn't recognise 
+               certain word in Subject header, but does in 
+               message body'. Patch by Pawel Pekala.
+
 2009-07-09 [paul]      3.7.2cvs3
 
        * configure.ac
index 0ea20808dcc3d5d521fd52544f7d4323416f2b7a..214d329fb80079b6aea9d267cdcb41703e78bef5 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.20 -r 1.1.2.21 tools/claws.i18n.status.pl;  ) > 3.7.2cvs1.patchset
 ( cvs diff -u -r 1.16.2.37 -r 1.16.2.38 src/prefs_customheader.c;  ) > 3.7.2cvs2.patchset
 ( cvs diff -u -r 1.654.2.3896 -r 1.654.2.3897 configure.ac;  ) > 3.7.2cvs3.patchset
+( cvs diff -u -r 1.1.2.7 -r 1.1.2.8 src/gtk/spell_entry.c;  ) > 3.7.2cvs4.patchset
index 64984905b0a05dc5956cc9a4a361a6e85c4a30fc..0c44ec847dd1d80e80f179613de222bc3496c48d 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=3
+EXTRA_VERSION=4
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 7fc6eb106602fb0027950ab3a0da54cd59606d1d..8783a31fad53f028d9d8a462592c8fc3c5353328 100644 (file)
@@ -257,6 +257,29 @@ static gboolean word_misspelled(ClawsSpellEntry *entry, int start, int end)
        return ret;
 }
 
+static gboolean is_word_end (GtkEntry *entry, const int offset)
+{
+       gchar *p = gtk_editable_get_chars(GTK_EDITABLE(entry), offset, offset+1);
+       gunichar ch;
+       
+       ch = g_utf8_get_char(p);
+       g_free(p);
+       
+       if (ch == '\0')
+               return TRUE;
+
+       if (ch == '\'') {
+               p = gtk_editable_get_chars(GTK_EDITABLE(entry), offset+1, offset+2);
+               ch = g_utf8_get_char(p);
+               g_free(p);
+               
+               return (g_unichar_isspace(ch) || g_unichar_ispunct(ch)
+                       || g_unichar_isdigit(ch));
+       }
+       
+       return (g_unichar_isspace(ch) || g_unichar_ispunct(ch));
+}
+
 static void entry_strsplit_utf8(GtkEntry *entry, gchar ***set, gint **starts, gint **ends)
 {
        PangoLayout   *layout;
@@ -286,7 +309,7 @@ static void entry_strsplit_utf8(GtkEntry *entry, gchar ***set, gint **starts, gi
 
                        /* Find the end of this string */
                        cend = i;
-                       while (!(log_attrs[cend].is_word_end))
+                       while (!is_word_end(entry, cend))
                                cend++;
 
                        /* Copy sub-string */