]> git.lyx.org Git - lyx.git/blobdiff - src/AppleSpellChecker.cpp
We only support gcc >= 4.9.
[lyx.git] / src / AppleSpellChecker.cpp
index 3ba1250b2dff695cb98ee551986f1a2bd32436bb..0a82d38b3228f04ee27ad3e45bbd889e6947690d 100644 (file)
@@ -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<WordLangTuple> 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<WordLangTuple>::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());