forked from qt-creator/qt-creator
C++: Accept UTF-8 byte arrays in type of expression
The model uses UTF-8 internally and it makes more sense to only convert when necessary. A following commit will rename the source/setSource methods in document for more clarity too. Change-Id: I960ea0754efabd1436ad4b4299a57faeb65a8bee Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
@@ -362,7 +362,8 @@ struct CanonicalSymbol
|
||||
|
||||
static Symbol *canonicalSymbol(Scope *scope, const QString &code, TypeOfExpression &typeOfExpression)
|
||||
{
|
||||
const QList<LookupItem> results = typeOfExpression(code, scope, TypeOfExpression::Preprocess);
|
||||
const QList<LookupItem> results =
|
||||
typeOfExpression(code.toUtf8(), scope, TypeOfExpression::Preprocess);
|
||||
|
||||
for (int i = results.size() - 1; i != -1; --i) {
|
||||
const LookupItem &r = results.at(i);
|
||||
@@ -1374,7 +1375,8 @@ CPPEditorWidget::Link CPPEditorWidget::findLinkAt(const QTextCursor &cursor,
|
||||
|
||||
TypeOfExpression typeOfExpression;
|
||||
typeOfExpression.init(doc, snapshot);
|
||||
const QList<LookupItem> resolvedSymbols = typeOfExpression.reference(expression, scope, TypeOfExpression::Preprocess);
|
||||
const QList<LookupItem> resolvedSymbols =
|
||||
typeOfExpression.reference(expression.toUtf8(), scope, TypeOfExpression::Preprocess);
|
||||
|
||||
if (!resolvedSymbols.isEmpty()) {
|
||||
LookupItem result = skipForwardDeclarations(resolvedSymbols);
|
||||
|
||||
Reference in New Issue
Block a user