Added a #WITH_OLD_HUNSPELL option on config.h to let Hunspell use Hunspell::put_word() instead of Hunspell:AddWord().

Originally committed to SVN as r1733.
This commit is contained in:
Rodrigo Braz Monteiro 2008-01-15 17:24:49 +00:00
parent 3b10cbd3c8
commit a3c8e61f16
2 changed files with 11 additions and 0 deletions

View File

@ -132,7 +132,11 @@ void HunspellSpellChecker::AddWord(wxString word) {
if (!hunspell) return;
// Add to currently loaded file
#ifdef WITH_OLD_HUNSPELL
hunspell->put_word(word.mb_str(*conv));
#else
hunspell->add(word.mb_str(*conv));
#endif
// Ensure that the path exists
wxFileName fn(usrdicpath);
@ -296,7 +300,11 @@ void HunspellSpellChecker::SetLanguage(wxString language) {
wxString curLine = textIn.ReadLine();
curLine.Trim();
if (curLine.IsEmpty() || curLine.IsNumber()) continue;
#ifdef WITH_OLD_HUNSPELL
hunspell->put_word(curLine.mb_str(*conv));
#else
hunspell->add(curLine.mb_str(*conv));
#endif
}
}
}

View File

@ -80,7 +80,10 @@
// Enable Hunspell-based spellchecker
// Requires: hunspell (in repository for Win32)
// If you have an old version of Hunspell (that uses Hunspell::put_word() instead of Hunspell::add()),
// uncomment the second line as well.
//#define WITH_HUNSPELL
//#define WITH_OLD_HUNSPELL
/////////////// LOW PRIORITY ////////////