| Index: components/spellcheck/renderer/hunspell_engine.cc
|
| diff --git a/components/spellcheck/renderer/hunspell_engine.cc b/components/spellcheck/renderer/hunspell_engine.cc
|
| index 8617aaa2185135f9e7b86f73e9535c600d834734..c3853483105a48ed19f23c374a19c26c8a431564 100644
|
| --- a/components/spellcheck/renderer/hunspell_engine.cc
|
| +++ b/components/spellcheck/renderer/hunspell_engine.cc
|
| @@ -86,7 +86,7 @@ bool HunspellEngine::CheckSpelling(const base::string16& word_to_check,
|
| // to check rather than crash.
|
| if (hunspell_.get()) {
|
| // |hunspell_->spell| returns 0 if the word is misspelled.
|
| - word_correct = (hunspell_->spell(word_to_check_utf8.c_str()) != 0);
|
| + word_correct = (hunspell_->spell(word_to_check_utf8) != 0);
|
| }
|
| }
|
|
|
| @@ -106,18 +106,14 @@ void HunspellEngine::FillSuggestionList(
|
| if (!hunspell_.get())
|
| return;
|
|
|
| - char** suggestions = NULL;
|
| - int number_of_suggestions =
|
| - hunspell_->suggest(&suggestions, wrong_word_utf8.c_str());
|
| + std::vector<std::string> suggestions =
|
| + hunspell_->suggest(wrong_word_utf8);
|
|
|
| // Populate the vector of WideStrings.
|
| - for (int i = 0; i < number_of_suggestions; ++i) {
|
| + for (size_t i = 0; i < suggestions.size(); ++i) {
|
| if (i < spellcheck::kMaxSuggestions)
|
| optional_suggestions->push_back(base::UTF8ToUTF16(suggestions[i]));
|
| - free(suggestions[i]);
|
| }
|
| - if (suggestions != NULL)
|
| - free(suggestions);
|
| }
|
|
|
| bool HunspellEngine::InitializeIfNeeded() {
|
|
|