Description: fixed a bug which inserts ampersands on spellcheck replace Qt5 added an automatic keyboard shortcut feature which inserts & symbols into menu labels representing which letter is a keyboard shortcut for that action. I added a QMap which associates the QAction pointer with the spelling suggestion so that the unmodified suggestion is inserted without the ampersand. . texmaker (4.4.1-1) unstable; urgency=medium . * New upstream release. * Refresh patches offset. * d/copyright: Remove files that aren't included by upstream anymore. * Bump Standards-Version to 3.9.6 (no changes). Author: Julián Moreno Patiño --- The information above should follow the Patch Tagging Guidelines, please checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here are templates for supplementary fields that you might want to add: Origin: , Bug: Bug-Debian: https://bugs.debian.org/ Bug-Ubuntu: https://launchpad.net/bugs/ Forwarded: Reviewed-By: Last-Update: --- texmaker-4.4.1.orig/latexeditor.cpp +++ texmaker-4.4.1/latexeditor.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -44,6 +45,8 @@ #include "blockdata.h" +QMap spellingLookup; + static void convertToPlainText(QString &txt) { QChar *uc = txt.data(); @@ -858,6 +861,7 @@ if (inlinecheckSpelling && pChecker && ! if (ns > 0) { suggWords.clear(); + spellingLookup.clear(); for (int i=0; i < ns; i++) { suggWords.append(codec->toUnicode(wlst[i])); @@ -872,8 +876,12 @@ if (inlinecheckSpelling && pChecker && ! { foreach (const QString &suggestion, suggWords) { - a = menu->addAction(suggestion, this, SLOT(correctWord())); + a = menu->addAction(suggestion, this, SLOT(correctWord()), + 0 + ); a->setFont(spellmenufont); + a->setText(suggestion); + spellingLookup.insert(a,suggestion); } } } @@ -957,8 +965,8 @@ void LatexEditor::correctWord() { QAction *action = qobject_cast(sender()); if (action) - { - QString newword = action->text(); + { + QString newword = spellingLookup.find(action).value(); replace(newword,false,""); } }