Fix hunspell suggestion call.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30930 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2009-08-09 13:43:58 +00:00
parent 354c436ae7
commit 697813c491

View File

@ -160,15 +160,13 @@ void HunspellChecker::suggest(WordLangTuple const & wl,
Hunspell * h = d->speller(wl.lang_code()); Hunspell * h = d->speller(wl.lang_code());
if (!h) if (!h)
return; return;
char *** suggestion_list = 0; char ** suggestion_list;
int const suggestion_number = h->suggest(&suggestion_list, word_to_check.c_str());
// FIXME: Hunspell::suggest() crashes on Win/MSVC9 if (suggestion_number <= 0)
return;
int const suggestion_number = h->suggest(suggestion_list, word_to_check.c_str());
if (suggestion_number == 0)
return; 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);
} }