diff options
author | Christian Kamm <christian.d.kamm@nokia.com> | 2011-06-03 08:49:40 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@nokia.com> | 2011-06-03 08:53:24 +0200 |
commit | b729d4b9738592bfb7bfd8f111b1173d7bfafefe (patch) | |
tree | 39831a3a2382811b044da4a9c5b24ae673e3a187 /src/plugins | |
parent | 362aef67e005a93172f4de2a61a80e433ac11463 (diff) | |
download | qt-creator-b729d4b9738592bfb7bfd8f111b1173d7bfafefe.tar.gz |
QmlJS: Fix uses of Scanner::state().
Change-Id: I5195fc43e8a6653bf52c0eaa6cddb8dfd25b6217
Reviewed-on: http://codereview.qt.nokia.com/319
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/qmljseditor/qmljsautocompleter.cpp | 4 | ||||
-rw-r--r-- | src/plugins/qmljseditor/qmljshighlighter.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/qmljseditor/qmljsautocompleter.cpp b/src/plugins/qmljseditor/qmljsautocompleter.cpp index 6bbd07c5fe..b160d3cedf 100644 --- a/src/plugins/qmljseditor/qmljsautocompleter.cpp +++ b/src/plugins/qmljseditor/qmljsautocompleter.cpp @@ -188,9 +188,9 @@ bool AutoCompleter::contextAllowsAutoParentheses(const QTextCursor &cursor, // if a string literal doesn't start with a quote, it must be multiline if (quote != QLatin1Char('"') && quote != QLatin1Char('\'')) { const int startState = blockStartState(cursor.block()); - if (startState == Scanner::MultiLineStringDQuote) + if ((startState & Scanner::MultiLineMask) == Scanner::MultiLineStringDQuote) quote = QLatin1Char('"'); - else if (startState == Scanner::MultiLineStringSQuote) + else if ((startState & Scanner::MultiLineMask) == Scanner::MultiLineStringSQuote) quote = QLatin1Char('\''); } diff --git a/src/plugins/qmljseditor/qmljshighlighter.cpp b/src/plugins/qmljseditor/qmljshighlighter.cpp index 55b917db35..a093c63938 100644 --- a/src/plugins/qmljseditor/qmljshighlighter.cpp +++ b/src/plugins/qmljseditor/qmljshighlighter.cpp @@ -108,7 +108,7 @@ void Highlighter::highlightBlock(const QString &text) onClosingParenthesis('-', token.end() - 1, index == tokens.size()-1); m_inMultilineComment = false; } else if (!m_inMultilineComment - && m_scanner.state() == Scanner::MultiLineComment + && (m_scanner.state() & Scanner::MultiLineMask) == Scanner::MultiLineComment && index == tokens.size() - 1) { onOpeningParenthesis('+', token.offset, index == 0); m_inMultilineComment = true; @@ -337,7 +337,7 @@ int Highlighter::onBlockStart() if (previousState != -1) { state = previousState & 0xff; m_braceDepth = (previousState >> 8); - m_inMultilineComment = (state == Scanner::MultiLineComment); + m_inMultilineComment = ((state & Scanner::MultiLineMask) == Scanner::MultiLineComment); } m_foldingIndent = m_braceDepth; |