CppTools: Fix auto-indent for break in switch statement

Change-Id: I954acb3acc1d7848517a079ffdd254b50052b67d
Task-number: QTCREATORBUG-13155
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
lemelisk
2014-10-14 17:56:29 +04:00
committed by Nikolai Kosjar
parent de33b3affa
commit b72a9dd239

View File

@@ -61,6 +61,7 @@ bool CppQtStyleIndenter::isElectricCharacter(const QChar &ch) const
case '#': case '#':
case '<': case '<':
case '>': case '>':
case ';':
return true; return true;
} }
return false; return false;
@@ -69,6 +70,8 @@ bool CppQtStyleIndenter::isElectricCharacter(const QChar &ch) const
static bool isElectricInLine(const QChar ch, const QString &text) static bool isElectricInLine(const QChar ch, const QString &text)
{ {
switch (ch.toLatin1()) { switch (ch.toLatin1()) {
case ';':
return text.contains(QLatin1String("break"));
case ':': case ':':
// switch cases and access declarations should be reindented // switch cases and access declarations should be reindented
if (text.contains(QLatin1String("case")) if (text.contains(QLatin1String("case"))