Changeset 127404 in webkit


Ignore:
Timestamp:
Sep 3, 2012 1:16:16 AM (12 years ago)
Author:
g.czajkowski@samsung.com
Message:

[GTK][EFL] 'dictIter' iterator is not initialized for an inner loop
https://bugs.webkit.org/show_bug.cgi?id=95436

Reviewed by Gustavo Noronha Silva.

Source/WebCore:

The 'checkSpellingOfString' method assumes that the given string is concatenation of words.
To properly handle spellchecking of each word we need to iterate over the all available
dictionaries ('dictIter').

To allow spellchecking for multiple words, 'dictIter' should be initialized at the beginning
of vector while spellchecking of the word. This ensures performing of spelling for word based on
at least one dictionary.

  • platform/text/enchant/TextCheckerEnchant.cpp:

(TextCheckerEnchant::checkSpellingOfString): Moved initialization of 'dictIter' to an inner loop.

LayoutTests:

'checkSpellingOfString' from the TextCheckerEnchant class can not mark multiplie words that are misspelled.
It's possible to mark misspeled string only by defining its location and length.

  • platform/gtk/TestExpectations: Added spelling-backspace-between-lines.html to TestExpectations.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r127403 r127404  
     12012-09-03  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
     2
     3        [GTK][EFL] 'dictIter' iterator is not initialized for an inner loop
     4        https://bugs.webkit.org/show_bug.cgi?id=95436
     5
     6        Reviewed by Gustavo Noronha Silva.
     7
     8        'checkSpellingOfString' from the TextCheckerEnchant class can not mark multiplie words that are misspelled.
     9        It's possible to mark misspeled string only by defining its location and length.
     10
     11        * platform/gtk/TestExpectations: Added spelling-backspace-between-lines.html to TestExpectations.
     12
    1132012-09-03  Christophe Dumez  <christophe.dumez@intel.com>
    214
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r127380 r127404  
    10261026BUGWKGTK SKIP : editing/spelling/grammar-paste.html = TEXT
    10271027
     1028// TextCheckerEnchant::checkSpellingOfString doesn't return misspelled location and length for multiple words.
     1029BUGWKGTK : editing/spelling/spelling-backspace-between-lines.html = TEXT
     1030
    10281031// testRunner::setTextDirection() is not implemented.
    10291032BUGWKGTK : fast/html/set-text-direction.html = TEXT
  • trunk/Source/WebCore/ChangeLog

    r127400 r127404  
     12012-09-03  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
     2
     3        [GTK][EFL] 'dictIter' iterator is not initialized for an inner loop
     4        https://bugs.webkit.org/show_bug.cgi?id=95436
     5
     6        Reviewed by Gustavo Noronha Silva.
     7
     8        The 'checkSpellingOfString' method assumes that the given string is concatenation of words.
     9        To properly handle spellchecking of each word we need to iterate over the all available
     10        dictionaries ('dictIter').
     11
     12        To allow spellchecking for multiple words, 'dictIter' should be initialized at the beginning
     13        of vector while spellchecking of the word. This ensures performing of spelling for word based on
     14        at least one dictionary.
     15
     16        * platform/text/enchant/TextCheckerEnchant.cpp:
     17        (TextCheckerEnchant::checkSpellingOfString): Moved initialization of 'dictIter' to an inner loop.
     18
    1192012-09-02  Yoshifumi Inoue  <yosin@chromium.org>
    220
  • trunk/Source/WebCore/platform/text/enchant/TextCheckerEnchant.cpp

    r126583 r127404  
    7979    CString utf8String = string.utf8();
    8080    const char* cString = utf8String.data();
    81     Vector<EnchantDict*>::const_iterator dictIter = m_enchantDictionaries.begin();
    8281
    8382    for (size_t i = 0; i < numberOfCharacters + 1; i++) {
     
    101100            int numberOfBytes = static_cast<int>(g_utf8_offset_to_pointer(cString, end) - cstart);
    102101
    103             for (; dictIter != m_enchantDictionaries.end(); ++dictIter) {
     102            for (Vector<EnchantDict*>::const_iterator dictIter = m_enchantDictionaries.begin(); dictIter != m_enchantDictionaries.end(); ++dictIter) {
    104103                if (enchant_dict_check(*dictIter, cstart, numberOfBytes)) {
    105104                    misspellingLocation = start;
Note: See TracChangeset for help on using the changeset viewer.