Skip to content

Commit

Permalink
Fix selection of language alias in spellcheck menu
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
stloeffler committed Sep 8, 2024
1 parent 56fbdc8 commit 072b1ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/TeXDocumentWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 072b1ae

Please sign in to comment.