diff options
author | mae <qt-info@nokia.com> | 2010-07-12 11:16:10 +0200 |
---|---|---|
committer | mae <qt-info@nokia.com> | 2010-07-12 11:18:31 +0200 |
commit | ab8a8c018d32f4a8905f52f7feedc75360225a69 (patch) | |
tree | 581cdb80c93edb8864299cf05053f63b249cd77d /src/plugins/cpptools/cppcodeformatter.cpp | |
parent | c1d93f4a45bdb433f36654bcc71d55a1bf4ee4b5 (diff) | |
download | qt-creator-ab8a8c018d32f4a8905f52f7feedc75360225a69.tar.gz |
Fix brace states
The lexer needs its own lexerState, before it was using
the syntax highlighter user state. This breaks the brace
depth calculation of the highlighter.
Reviewed-by: Roberto Raggi
Diffstat (limited to 'src/plugins/cpptools/cppcodeformatter.cpp')
-rw-r--r-- | src/plugins/cpptools/cppcodeformatter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/cpptools/cppcodeformatter.cpp b/src/plugins/cpptools/cppcodeformatter.cpp index 3c24648e96..75fe53fda8 100644 --- a/src/plugins/cpptools/cppcodeformatter.cpp +++ b/src/plugins/cpptools/cppcodeformatter.cpp @@ -857,7 +857,7 @@ int CodeFormatter::tokenizeBlock(const QTextBlock &block, bool *endedJoined) *endedJoined = tokenize.endedJoined(); const int lexerState = tokenize.state(); - TextBlockUserData::setLexerState(block, lexerState); + BaseTextDocumentLayout::setLexerState(block, lexerState); return lexerState; } @@ -942,12 +942,12 @@ bool QtStyleCodeFormatter::loadBlockData(const QTextBlock &block, BlockData *dat void QtStyleCodeFormatter::saveLexerState(QTextBlock *block, int state) const { - TextBlockUserData::setLexerState(*block, state); + BaseTextDocumentLayout::setLexerState(*block, state); } int QtStyleCodeFormatter::loadLexerState(const QTextBlock &block) const { - return TextBlockUserData::lexerState(block); + return BaseTextDocumentLayout::lexerState(block); } void QtStyleCodeFormatter::onEnter(int newState, int *indentDepth, int *savedIndentDepth) const |