From a49395a0eabc0ecfb8434e826d75419af5c6b06f Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Mon, 21 Sep 2009 16:09:01 +0200 Subject: Made the indenter more Qt friendly. Added support for moc keywords. --- src/libs/cplusplus/MatchingText.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/libs/cplusplus/MatchingText.cpp') 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(); -- cgit v1.2.1