forked from qt-creator/qt-creator
		
	Merge remote branch 'origin/1.3'
This commit is contained in:
		| @@ -71,13 +71,14 @@ const SimpleToken &BackwardsScanner::fetchToken(int i) | ||||
|         } else { | ||||
|             ++_blocksTokenized; | ||||
|  | ||||
|             const QString blockText = _block.text(); | ||||
|             QString blockText = _block.text(); | ||||
|             _text.prepend(QLatin1Char('\n')); | ||||
|             _text.prepend(blockText); | ||||
|  | ||||
|             QList<SimpleToken> adaptedTokens; | ||||
|             for (int i = 0; i < _tokens.size(); ++i) { | ||||
|                 SimpleToken t = _tokens.at(i); | ||||
|                 t.setPosition(t.position() + blockText.length()); | ||||
|                 t.setPosition(t.position() + blockText.length() + 1); | ||||
|                 t.setText(_text.midRef(t.position(), t.length())); | ||||
|                 adaptedTokens.append(t); | ||||
|             } | ||||
| @@ -248,8 +249,9 @@ int BackwardsScanner::startOfBlock(int index) const | ||||
|     return start; | ||||
| } | ||||
|  | ||||
| int BackwardsScanner::indentation(int index) const | ||||
| QString BackwardsScanner::indentationString(int index) const | ||||
| { | ||||
|     SimpleToken newline = operator[](startOfLine(index + 1)); | ||||
|     return newline.position(); | ||||
|     const SimpleToken tokenAfterNewline = operator[](startOfLine(index + 1)); | ||||
|     const int newlinePos = qMax(0, _text.lastIndexOf(QLatin1Char('\n'), tokenAfterNewline.position())); | ||||
|     return _text.mid(newlinePos, tokenAfterNewline.position() - newlinePos); | ||||
| } | ||||
|   | ||||
| @@ -61,7 +61,7 @@ public: | ||||
|     // n-la token is [startToken - n] | ||||
|     SimpleToken operator[](int index) const; // ### deprecate | ||||
|  | ||||
|     int indentation(int index) const; | ||||
|     QString indentationString(int index) const; | ||||
|  | ||||
|     int startOfLine(int index) const; | ||||
|     int startOfMatchingBrace(int index) const; | ||||
|   | ||||
| @@ -641,6 +641,7 @@ ResolveExpression::resolveBaseExpression(const QList<LookupItem> &baseResults, i | ||||
|             foreach (Symbol *typedefCandidate, typedefCandidates) { | ||||
|                 if (typedefCandidate->isTypedef() && typedefCandidate->type()->isNamedType()) { | ||||
|                     ty = typedefCandidate->type(); | ||||
|                     lastVisibleSymbol = typedefCandidate; | ||||
|                     break; | ||||
|                 } | ||||
|             } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user