diff options
Diffstat (limited to 'Swift/QtUI/QtSpellCheckHighlighter.cpp')
-rw-r--r-- | Swift/QtUI/QtSpellCheckHighlighter.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Swift/QtUI/QtSpellCheckHighlighter.cpp b/Swift/QtUI/QtSpellCheckHighlighter.cpp index 0112d7a..cb467e2 100644 --- a/Swift/QtUI/QtSpellCheckHighlighter.cpp +++ b/Swift/QtUI/QtSpellCheckHighlighter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Isode Limited. + * Copyright (c) 2014-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -21,21 +21,21 @@ QtSpellCheckHighlighter::~QtSpellCheckHighlighter() { } void QtSpellCheckHighlighter::highlightBlock(const QString& text) { - misspelledPositions_.clear(); - std::string fragment = Q2PSTRING(text); - checker_->checkFragment(fragment, misspelledPositions_); + misspelledPositions_.clear(); + std::string fragment = Q2PSTRING(text); + checker_->checkFragment(fragment, misspelledPositions_); - QTextCharFormat spellingErrorFormat; - spellingErrorFormat.setUnderlineColor(QColor(Qt::red)); - spellingErrorFormat.setUnderlineStyle(QTextCharFormat::SpellCheckUnderline); + QTextCharFormat spellingErrorFormat; + spellingErrorFormat.setUnderlineColor(QColor(Qt::red)); + spellingErrorFormat.setUnderlineStyle(QTextCharFormat::SpellCheckUnderline); - foreach (PositionPair position, misspelledPositions_) { - setFormat(boost::get<0>(position), boost::get<1>(position) - boost::get<0>(position), spellingErrorFormat); - }; + for (auto&& position : misspelledPositions_) { + setFormat(boost::get<0>(position), boost::get<1>(position) - boost::get<0>(position), spellingErrorFormat); + }; } PositionPairList QtSpellCheckHighlighter::getMisspelledPositions() const { - return misspelledPositions_; + return misspelledPositions_; } } |