diff options
Diffstat (limited to 'src/plugins/cpptools/cppqtstyleindenter.cpp')
-rw-r--r-- | src/plugins/cpptools/cppqtstyleindenter.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/cpptools/cppqtstyleindenter.cpp b/src/plugins/cpptools/cppqtstyleindenter.cpp index eb557a9bde..1b8ccb66fc 100644 --- a/src/plugins/cpptools/cppqtstyleindenter.cpp +++ b/src/plugins/cpptools/cppqtstyleindenter.cpp @@ -84,9 +84,12 @@ static bool isElectricInLine(const QChar ch, const QString &text) // lines that start with : might have a constructor initializer list case '<': case '>': { - // Electrical if at line beginning (after space indentation) - const QString trimmedtext = text.trimmed(); - return !trimmedtext.isEmpty() && trimmedtext.at(0) == ch; + // Electric if at line beginning (after space indentation) + for (int i = 0, len = text.count(); i < len; ++i) { + if (!text.at(i).isSpace()) + return text.at(i) == ch; + } + return false; } } |