Commit 0ee61159 authored by hjk's avatar hjk
Browse files

qmljshighlighter: un-templatize setFormats()

This is used excatly once.

ReviewedBy: Kai Koehne
parent 90bd0098
......@@ -915,8 +915,7 @@ void QmlJSTextEditor::setFontSettings(const TextEditor::FontSettings &fs)
<< QLatin1String(TextEditor::Constants::C_VISUAL_WHITESPACE);
}
const QVector<QTextCharFormat> formats = fs.toTextCharFormats(categories);
highlighter->setFormats(formats.constBegin(), formats.constEnd());
highlighter->setFormats(fs.toTextCharFormats(categories));
highlighter->rehighlight();
m_occurrencesFormat = fs.toTextCharFormat(QLatin1String(TextEditor::Constants::C_OCCURRENCES));
......
......@@ -82,6 +82,12 @@ static bool checkStartOfBinding(const Token &token)
} // end of switch
}
void Highlighter::setFormats(const QVector<QTextCharFormat> &formats)
{
QTC_ASSERT(formats.size() == NumFormats, return);
qCopy(formats.begin(), formats.end(), m_formats);
}
void Highlighter::highlightBlock(const QString &text)
{
const QList<Token> tokens = m_scanner(text, onBlockStart());
......
......@@ -63,14 +63,7 @@ public:
bool isQmlEnabled() const;
void setQmlEnabled(bool duiEnabled);
// MS VC 6 compatible, still.
// Set formats from a sequence of type QTextCharFormat
template <class InputIterator>
void setFormats(InputIterator begin, InputIterator end)
{
qCopy(begin, end, m_formats);
}
void setFormats(const QVector<QTextCharFormat> &formats);
QTextCharFormat labelTextCharFormat() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment