X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FAppleSpellChecker.cpp;h=0a82d38b3228f04ee27ad3e45bbd889e6947690d;hb=b08a653f3549e08fffc5318c87da305651ecc197;hp=3ba1250b2dff695cb98ee551986f1a2bd32436bb;hpb=7b652117d6c956edd17f84d7d22a96419e7eccdc;p=lyx.git diff --git a/src/AppleSpellChecker.cpp b/src/AppleSpellChecker.cpp index 3ba1250b2d..0a82d38b32 100644 --- a/src/AppleSpellChecker.cpp +++ b/src/AppleSpellChecker.cpp @@ -78,13 +78,23 @@ string AppleSpellChecker::Private::toString(SpellCheckResult status) } -SpellChecker::Result AppleSpellChecker::check(WordLangTuple const & word) +SpellChecker::Result AppleSpellChecker::check(WordLangTuple const & word, + std::vector const & docdict) { if (!hasDictionary(word.lang())) return NO_DICTIONARY; string const word_str = to_utf8(word.word()); string const lang = d->languageMap[word.lang()->lang()]; + + vector::const_iterator it = docdict.begin(); + for (; it != docdict.end(); ++it) { + if (it->lang()->code() != word.lang()->code()) + continue; + if (it->word() == word.word()) + return DOCUMENT_LEARNED_WORD; + } + SpellCheckResult result = AppleSpeller_check(d->speller, word_str.c_str(), lang.c_str());