Changeset 121360 in webkit
- Timestamp:
- Jun 27, 2012 1:22:32 PM (12 years ago)
- Location:
- trunk/Source/WebKit/gtk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/gtk/ChangeLog
r121332 r121360 1 2012-06-27 Martin Robinson <mrobinson@igalia.com> 2 3 [gtk] Spell checker doesn't recognize contractions (apostrophes) 4 https://bugs.webkit.org/show_bug.cgi?id=86118 5 6 Reviewed by Gustavo Noronha Silva. 7 8 Work-around a bug in Pango by trying to detect apostrophes 9 that create contractions. This work-around is similar to one 10 found in gtkspell. 11 12 * webkit/webkitspellcheckerenchant.cpp: 13 (wordEndIsAContractionApostrophe): Added this helper which tries to detect 14 situations where a word end is both an apostrophe and followed by a alphabetic 15 character. 16 (checkSpellingOfString): When searching for the end of a word, skip over 17 apostrophes that appear to be part of contractions. 18 1 19 2012-06-27 Zan Dobersek <zandobersek@gmail.com> 2 20 -
trunk/Source/WebKit/gtk/webkit/webkitspellcheckerenchant.cpp
r119159 r121360 87 87 88 88 priv->enchantDicts = 0; 89 } 90 91 static bool wordEndIsAContractionApostrophe(const char* string, long offset) 92 { 93 if (g_utf8_get_char(g_utf8_offset_to_pointer(string, offset)) != g_utf8_get_char("'")) 94 return false; 95 96 // If this is the last character in the string, it cannot be the apostrophe part of a contraction. 97 if (offset == g_utf8_strlen(string, -1)) 98 return false; 99 100 return g_unichar_isalpha(g_utf8_get_char(g_utf8_offset_to_pointer(string, offset + 1))); 89 101 } 90 102 … … 114 126 int wordLength; 115 127 116 while (attrs.get()[end].is_word_end < 1 )128 while (attrs.get()[end].is_word_end < 1 || wordEndIsAContractionApostrophe(string, end)) 117 129 end++; 118 130
Note: See TracChangeset
for help on using the changeset viewer.