]> git.lyx.org Git - features.git/commitdiff
Fix broken Apple speller interface master
authorStephan Witt <switt@lyx.org>
Wed, 16 Nov 2022 06:39:44 +0000 (07:39 +0100)
committerStephan Witt <switt@lyx.org>
Fri, 25 Nov 2022 08:07:40 +0000 (09:07 +0100)
- restore spell checker result LEARNED_WORD - it's required for Apple speller engine
- avoid use of "unlearn" of known dictionary word - it doesn't work with paragraph based spell check

src/SpellChecker.h
src/frontends/qt/Menus.cpp

index e3c65707b6efb0f09e8e5bb35c8c9563d45bfd28..6b27c297cbafae6d01fbb0d4c1ca2c800b2a0f9d 100644 (file)
@@ -36,6 +36,8 @@ public:
                WORD_OK = 1,
                /// word not found
                UNKNOWN_WORD,
+               /// number of personal dictionary "word"
+               LEARNED_WORD,
                /// number of document dictionary "word"
                DOCUMENT_LEARNED_WORD,
                /// missing dictionary for language
@@ -50,6 +52,7 @@ public:
        static bool misspelled(Result res) {
                return res != WORD_OK
                        && res != NO_DICTIONARY
+                       && res != LEARNED_WORD
                        && res != DOCUMENT_LEARNED_WORD; }
 
        /// check the given word of the given lang code and return the result
index f4a2358f3cf79f286bfce00bde57de191a16e7ee..c69ba5f0bcdc7dacf88c7740b861b0ecbae0b5fc 100644 (file)
@@ -883,7 +883,15 @@ void MenuDefinition::expandSpellingSuggestions(BufferView const * bv)
        case SpellChecker::WORD_OK: {
                        if (wl.word().empty())
                                break;
+                       SpellChecker * speller = theSpellChecker();
+                       if (speller && speller->canCheckParagraph())
+                               break;
                        LYXERR(Debug::GUI, "Valid Word.");
+               }
+               // FALLTHROUGH
+       case SpellChecker::LEARNED_WORD: {
+                       if (res == SpellChecker::LEARNED_WORD)
+                               LYXERR(Debug::GUI, "Learned Word.");
                        docstring const arg = wl.word() + " " + from_ascii(wl.lang()->lang());
                        add(MenuItem(MenuItem::Command, qt_("Remove from personal dictionary|r"),
                                        FuncRequest(LFUN_SPELLING_REMOVE, arg)));