diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2009-09-21 16:09:01 +0200 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2009-09-21 16:10:17 +0200 |
commit | a49395a0eabc0ecfb8434e826d75419af5c6b06f (patch) | |
tree | b56f18015d45e1ba8ee1b7244727f38ce33b2c97 /src/libs/cplusplus/MatchingText.cpp | |
parent | 0bcbab862e43fc041380155db1af30f38090114f (diff) | |
download | qt-creator-a49395a0eabc0ecfb8434e826d75419af5c6b06f.tar.gz |
Made the indenter more Qt friendly. Added support for moc keywords.
Diffstat (limited to 'src/libs/cplusplus/MatchingText.cpp')
-rw-r--r-- | src/libs/cplusplus/MatchingText.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libs/cplusplus/MatchingText.cpp b/src/libs/cplusplus/MatchingText.cpp index 8813e890be..877145d886 100644 --- a/src/libs/cplusplus/MatchingText.cpp +++ b/src/libs/cplusplus/MatchingText.cpp @@ -49,9 +49,9 @@ static bool shouldOverrideChar(const QChar &ch) } } -static bool isCompleteStringLiteral(const BackwardsScanner &tk, int index, int startToken) +static bool isCompleteStringLiteral(const BackwardsScanner &tk, int index) { - const QStringRef text = tk.textRef(index, startToken); + const QStringRef text = tk.textRef(index); if (text.length() < 2) return false; @@ -62,9 +62,9 @@ static bool isCompleteStringLiteral(const BackwardsScanner &tk, int index, int s return false; } -static bool isCompleteCharLiteral(const BackwardsScanner &tk, int index, int startToken) +static bool isCompleteCharLiteral(const BackwardsScanner &tk, int index) { - const QStringRef text = tk.textRef(index, startToken); + const QStringRef text = tk.textRef(index); if (text.length() < 2) return false; @@ -133,7 +133,7 @@ QString MatchingText::insertMatchingBrace(const QTextCursor &cursor, const QStri if (text.length() != 1) qWarning() << Q_FUNC_INFO << "handle event compression"; - if (isCompleteStringLiteral(tk, index - 1, startToken)) + if (isCompleteStringLiteral(tk, index - 1)) return QLatin1String("\""); return QString(); @@ -141,7 +141,7 @@ QString MatchingText::insertMatchingBrace(const QTextCursor &cursor, const QStri if (text.length() != 1) qWarning() << Q_FUNC_INFO << "handle event compression"; - if (isCompleteCharLiteral(tk, index - 1, startToken)) + if (isCompleteCharLiteral(tk, index - 1)) return QLatin1String("'"); return QString(); |