]> git.lyx.org Git - lyx.git/blobdiff - src/HunspellChecker.cpp
Hopefully this works on other archs too.
[lyx.git] / src / HunspellChecker.cpp
index f024f2ec0268d15382a6d098714ef96044739e81..56b0c26952eac0040f1acc6b50c125fc9e0c1b96 100644 (file)
@@ -160,15 +160,13 @@ void HunspellChecker::suggest(WordLangTuple const & wl,
        Hunspell * h = d->speller(wl.lang_code());
        if (!h)
                return;
-       char *** suggestion_list = 0;
-
-       // FIXME: Hunspell::suggest() crashes on Win/MSVC9
-       return;
-
-       int const suggestion_number = h->suggest(suggestion_list, word_to_check.c_str());
-       if (suggestion_number == 0)
+       char ** suggestion_list;
+       int const suggestion_number = h->suggest(&suggestion_list, word_to_check.c_str());
+       if (suggestion_number <= 0)
                return;
-       h->free_list(suggestion_list, suggestion_number);
+       for (int i = 0; i != suggestion_number; ++i)
+               suggestions.push_back(from_utf8(suggestion_list[i]));
+       h->free_list(&suggestion_list, suggestion_number);
 }