From 072b1ae2779546efa53b8f2c78bb84f68f6c56fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20L=C3=B6ffler?= Date: Sun, 8 Sep 2024 07:53:33 +0200 Subject: [PATCH] Fix selection of language alias in spellcheck menu When there were several aliases for a given language (e.g., due to symlinked dictionaries), previously, the first of these aliases was always selected. However, this did not necessarily correspond to the alias the user selected (e.g., in the preferences). --- src/TeXDocumentWindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TeXDocumentWindow.cpp b/src/TeXDocumentWindow.cpp index f3ac75c9..bf61c9ee 100644 --- a/src/TeXDocumentWindow.cpp +++ b/src/TeXDocumentWindow.cpp @@ -487,9 +487,9 @@ void TeXDocumentWindow::setSpellcheckLanguage(const QString& lang) if (menuSpelling) { QAction *chosen = menuSpelling->actions()[0]; // default is None - foreach (QAction *act, menuSpelling->actions()) { + foreach(QString alias, langAliases) { bool found = false; - foreach(QString alias, langAliases) { + foreach (QAction *act, menuSpelling->actions()) { if (act->text() == alias || act->text().contains(QString::fromLatin1("(%1)").arg(alias))) { chosen = act; found = true;