[LyX/master] \\spellchecker_ignore: use LyX language name rather than langcode

Juergen Spitzmueller spitz at lyx.org
Sun Mar 7 07:16:37 UTC 2021


commit 0b42f77551e607e59ac4fa98e5b926fb10a45baf
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sun Mar 7 08:21:23 2021 +0100

    \\spellchecker_ignore: use LyX language name rather than langcode
---
 src/BufferParams.cpp |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index 4927741..d4fb384 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -1051,9 +1051,9 @@ string BufferParams::readToken(Lexer & lex, string const & token,
 	} else if (token == "\\spellchecker_ignore") {
 		lex.eatLine();
 		docstring wl = lex.getDocString();
-		docstring langcode;
-		docstring word = split(wl, langcode, ' ');
-		Language const * lang = languages.getFromCode(to_ascii(langcode));
+		docstring language;
+		docstring word = split(wl, language, ' ');
+		Language const * lang = languages.getLanguage(to_ascii(language));
 		if (lang)
 			spellignore().push_back(WordLangTuple(word, lang));
 	} else if (token == "\\author") {
@@ -1433,7 +1433,7 @@ void BufferParams::writeFile(ostream & os, Buffer const * buf) const
 	}
 
 	for (auto const & si : spellignore()) {
-		os << "\\spellchecker_ignore " << si.lang()->code()
+		os << "\\spellchecker_ignore " << si.lang()->lang()
 		   << " " << to_utf8(si.word())
 		   << "\n";
 	}


More information about the lyx-cvs mailing list