[Webkit-unassigned] [Bug 15616] [GTK] Add spell checking (and grammar?)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 12 07:23:44 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=15616





------- Comment #7 from gns at gnome.org  2009-03-12 07:23 PDT -------
(From update of attachment 28348)
OK, now for what's probably not working

> +    ctext = g_strstrip (g_utf16_to_utf8(const_cast<gunichar2*>(text), length, 
> +                NULL, NULL, NULL));
[...]
> +    int i = 0;
> +    while (ctext[i] != ' ' && i < length)
> +        i++;
[...]
> +        result = enchant_dict_check(lang->speller,
> +                    ctext, -1);

So here's my theory on why this is not working. You are asking enchant to test
the whole string, even though you have gone out of your way to find the first
word, looking for a space. You really need to feed only the first word to it,
as I understand it.

[...]
> +        if (misspellingLength)
> +            *misspellingLength = i;
> +    }

Then you only set misspellingLength, but you did not set misspellingLocation.
Notice that the code in Editor.cpp only does anything if misspellingLocation is
>= 0. It will be -1 the way your code looks currently. I believe the code in
Editor.cpp is working correctly, but you need to give it correct return values
in both misspellingLocation and misspellingLength.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list