diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2013-07-17 00:01:45 +0300 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2013-07-17 11:11:25 +0200 |
commit | ad9e7ccab6e8476c0cb478ea2e4f13354dc21635 (patch) | |
tree | 9c67e7cfec7e7d0603e9279de9227cdef1cac530 /src/plugins/cppeditor/cpphighlighter.cpp | |
parent | c67f7f63497b321f42ee0081f29b7e3804023a10 (diff) |
Fix coding style for else statements
Change-Id: I1309db70e98d678e150388c76ce665e988fdf081
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Diffstat (limited to 'src/plugins/cppeditor/cpphighlighter.cpp')
-rw-r--r-- | src/plugins/cppeditor/cpphighlighter.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/plugins/cppeditor/cpphighlighter.cpp b/src/plugins/cppeditor/cpphighlighter.cpp index 5b02d92502..762f11ce19 100644 --- a/src/plugins/cppeditor/cpphighlighter.cpp +++ b/src/plugins/cppeditor/cpphighlighter.cpp @@ -160,13 +160,11 @@ void CppHighlighter::highlightBlock(const QString &text) onlyHighlightComments = true; } - } else if (tk.is(T_NUMERIC_LITERAL)) + } else if (tk.is(T_NUMERIC_LITERAL)) { setFormat(tk.begin(), tk.length(), m_formats[CppNumberFormat]); - - else if (tk.isStringLiteral() || tk.isCharLiteral()) + } else if (tk.isStringLiteral() || tk.isCharLiteral()) { highlightLine(text, tk.begin(), tk.length(), m_formats[CppStringFormat]); - - else if (tk.isComment()) { + } else if (tk.isComment()) { const int startPosition = initialState ? previousTokenEnd : tk.begin(); if (tk.is(T_COMMENT) || tk.is(T_CPP_COMMENT)) highlightLine(text, startPosition, tk.end() - startPosition, m_formats[CppCommentFormat]); @@ -192,18 +190,15 @@ void CppHighlighter::highlightBlock(const QString &text) initialState = 0; } - } else if (tk.isKeyword() || CppTools::isQtKeyword(text.midRef(tk.begin(), tk.length())) || tk.isObjCAtKeyword()) + } else if (tk.isKeyword() || CppTools::isQtKeyword(text.midRef(tk.begin(), tk.length())) || tk.isObjCAtKeyword()) { setFormat(tk.begin(), tk.length(), m_formats[CppKeywordFormat]); - - else if (tk.isOperator()) + } else if (tk.isOperator()) { setFormat(tk.begin(), tk.length(), m_formats[CppOperatorFormat]); - - else if (i == 0 && tokens.size() > 1 && tk.is(T_IDENTIFIER) && tokens.at(1).is(T_COLON)) + } else if (i == 0 && tokens.size() > 1 && tk.is(T_IDENTIFIER) && tokens.at(1).is(T_COLON)) { setFormat(tk.begin(), tk.length(), m_formats[CppLabelFormat]); - - else if (tk.is(T_IDENTIFIER)) + } else if (tk.is(T_IDENTIFIER)) { highlightWord(text.midRef(tk.begin(), tk.length()), tk.begin(), tk.length()); - + } } // mark the trailing white spaces |