From feda8a7db8d1d7c5439aa8f8feef7cc0dd2b59a0 Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Fri, 27 Jul 2018 23:51:12 -0400 Subject: New upstream version 3.2.1+dfsg1 --- SQLiteStudio3/coreSQLiteStudio/parser/token.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'SQLiteStudio3/coreSQLiteStudio/parser/token.cpp') diff --git a/SQLiteStudio3/coreSQLiteStudio/parser/token.cpp b/SQLiteStudio3/coreSQLiteStudio/parser/token.cpp index 5396edd..cd7e4b0 100644 --- a/SQLiteStudio3/coreSQLiteStudio/parser/token.cpp +++ b/SQLiteStudio3/coreSQLiteStudio/parser/token.cpp @@ -210,13 +210,21 @@ QString TokenList::toString() const QStringList TokenList::toStringList() const { QStringList strList; - TokenPtr t; - foreach (t, *this) + for (const TokenPtr& t : *this) strList << t->toString(); return strList; } +QStringList TokenList::toValueList() const +{ + QStringList strList; + for (const TokenPtr& t : *this) + strList << t->value; + + return strList; +} + int TokenList::indexOf(TokenPtr token) const { return QList::indexOf(token); @@ -301,7 +309,7 @@ TokenPtr TokenList::findLast(const QString& value, Qt::CaseSensitivity caseSensi TokenPtr TokenList::atCursorPosition(quint64 cursorPosition) const { - foreach (TokenPtr token, *this) + for (TokenPtr token : *this) { if (token->getRange().contains(cursorPosition)) return token; @@ -311,7 +319,7 @@ TokenPtr TokenList::atCursorPosition(quint64 cursorPosition) const void TokenList::insert(int i, const TokenList &list) { - foreach (TokenPtr token, list) + for (TokenPtr token : list) QList::insert(i++, token); } @@ -483,7 +491,7 @@ TokenList& TokenList::trim(Token::Type type, const QString& alsoTrim) TokenList TokenList::filter(Token::Type type) const { TokenList filtered; - foreach (TokenPtr token, *this) + for (TokenPtr token : *this) if (token->type == type) filtered << token; @@ -493,7 +501,7 @@ TokenList TokenList::filter(Token::Type type) const TokenList TokenList::filterOut(Token::Type type) const { TokenList filtered; - foreach (TokenPtr token, *this) + for (TokenPtr token : *this) if (token->type != type) filtered << token; @@ -503,7 +511,7 @@ TokenList TokenList::filterOut(Token::Type type) const TokenList TokenList::filterWhiteSpaces(bool includeComments) const { TokenList filtered; - foreach (TokenPtr token, *this) + for (TokenPtr token : *this) if (!token->isWhitespace(includeComments)) filtered << token; -- cgit v1.2.3