summaryrefslogtreecommitdiff
path: root/src/webtab
diff options
context:
space:
mode:
authorLindsay Mathieson <lindsay.mathieson@gmail.com>2013-02-03 08:48:23 +1000
committerLindsay Mathieson <lindsay.mathieson@gmail.com>2013-02-03 08:48:23 +1000
commit422bfa58e3fe4f7ae819c048fb3ca86296cd45c4 (patch)
tree88faad80d2797a0cf12cdf45e3b691bfe7cd7ec8 /src/webtab
parentSVN_SILENT made messages (.desktop file) (diff)
downloadrekonq-422bfa58e3fe4f7ae819c048fb3ca86296cd45c4.tar.xz
Allows quote char to be used in replacement words, e.g "thats" => "that's"
Disables annoying "spell Check Complete" modal notification
Diffstat (limited to 'src/webtab')
-rw-r--r--src/webtab/webview.cpp6
1 files changed, 3 insertions, 3 deletions
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(")");