summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcodeformatter.cpp
diff options
context:
space:
mode:
authorChristian Kamm <christian.d.kamm@nokia.com>2010-10-06 13:50:04 +0200
committerChristian Kamm <christian.d.kamm@nokia.com>2010-10-08 13:09:26 +0200
commit7e3294a8ce580961120e73895844ae9e71a76602 (patch)
tree95bd7066dd681db2702693b6e0eb78d619bde7be /src/plugins/cpptools/cppcodeformatter.cpp
parent074cfd67104affac7a51046821bb453e6b00697e (diff)
downloadqt-creator-7e3294a8ce580961120e73895844ae9e71a76602.tar.gz
C++ indenter: Don't get confused on 'for (a in b)'.
Reviewed-by: Roberto Raggi Reviewed-by: Erik Verbruggen (cherry picked from commit c2d890f65e3d1975022aec4a70a93c53e43f38bc)
Diffstat (limited to 'src/plugins/cpptools/cppcodeformatter.cpp')
-rw-r--r--src/plugins/cpptools/cppcodeformatter.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcodeformatter.cpp b/src/plugins/cpptools/cppcodeformatter.cpp
index 3a7462be9b..3c13d10f58 100644
--- a/src/plugins/cpptools/cppcodeformatter.cpp
+++ b/src/plugins/cpptools/cppcodeformatter.cpp
@@ -317,12 +317,14 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
switch (kind) {
case T_SEMICOLON: turnInto(for_statement_condition); break;
case T_LPAREN: enter(condition_paren_open); break;
+ case T_RPAREN: turnInto(for_statement_expression); continue;
} break;
case for_statement_condition:
switch (kind) {
case T_SEMICOLON: turnInto(for_statement_expression); break;
case T_LPAREN: enter(condition_paren_open); break;
+ case T_RPAREN: turnInto(for_statement_expression); continue;
} break;
case for_statement_expression: