From 422bfa58e3fe4f7ae819c048fb3ca86296cd45c4 Mon Sep 17 00:00:00 2001 From: Lindsay Mathieson Date: Sun, 3 Feb 2013 08:48:23 +1000 Subject: Allows quote char to be used in replacement words, e.g "thats" => "that's" Disables annoying "spell Check Complete" modal notification --- src/webtab/webview.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/webtab/webview.cpp b/src/webtab/webview.cpp index 1df13dcd..f668e89d 100644 --- a/src/webtab/webview.cpp +++ b/src/webtab/webview.cpp @@ -250,7 +250,7 @@ bool WebView::popupSpellMenu(QContextMenuEvent *event) QString script(QL1S("this.value=this.value.substring(0,")); script += QString::number(s1); script += QL1S(") + \'"); - script += w; + script += w.replace('\'', "\\\'"); // Escape any Quote marks in replacement word script += QL1C('\'') + QL1S("+this.value.substring("); script += QString::number(s2); script += QL1C(')'); @@ -1429,7 +1429,6 @@ void WebView::spellCheck() backgroundSpellCheck->setParent(spellDialog); spellDialog->setAttribute(Qt::WA_DeleteOnClose, true); - spellDialog->showSpellCheckCompletionMessage(true); connect(spellDialog, SIGNAL(replace(QString,int,QString)), this, SLOT(spellCheckerCorrected(QString,int,QString))); connect(spellDialog, SIGNAL(misspelling(QString,int)), this, SLOT(spellCheckerMisspelling(QString,int))); if (m_contextMenuHitResult.isContentSelected()) @@ -1451,7 +1450,8 @@ void WebView::spellCheckerCorrected(const QString& original, int pos, const QStr QString script(QL1S("this.value=this.value.substring(0,")); script += QString::number(index); script += QL1S(") + \""); - script += replacement; + QString w(replacement); + script += w.replace('\'', "\\\'"); // Escape any Quote marks in replacement word script += QL1S("\" + this.value.substring("); script += QString::number(index + original.length()); script += QL1S(")"); -- cgit v1.2.1