X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FText3.cpp;h=40fff5dbe5cfbb92aa4e14dbef65b714deef4f0c;hb=e4f2484cb5899da6d98e0be6db465ca011989e04;hp=a871a62d1b979e0b4868b7488f6d217fe8f4cfaf;hpb=f5e2d7879276d25b1de2cd493db1712bf9d96b0e;p=lyx.git diff --git a/src/Text3.cpp b/src/Text3.cpp index a871a62d1b..40fff5dbe5 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -2044,6 +2044,25 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) break; } + case LFUN_SPELLING_REMOVE: { + docstring word = from_utf8(cmd.getArg(0)); + Language * lang; + if (word.empty()) { + word = cur.selectionAsString(false); + // FIXME + if (word.size() > 100 || word.empty()) { + // Get word or selection + selectWordWhenUnderCursor(cur, WHOLE_WORD); + word = cur.selectionAsString(false); + } + lang = const_cast(cur.getFont().language()); + } else + lang = const_cast(languages.getLanguage(cmd.getArg(1))); + WordLangTuple wl(word, lang); + theSpellChecker()->remove(wl); + break; + } + case LFUN_PARAGRAPH_PARAMS_APPLY: { // Given data, an encoding of the ParagraphParameters // generated in the Paragraph dialog, this function sets @@ -2591,6 +2610,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd, case LFUN_SPELLING_ADD: case LFUN_SPELLING_IGNORE: + case LFUN_SPELLING_REMOVE: enable = theSpellChecker(); break;