Save the utf8 bytes in a QByteArray before invoking the parser.

This commit is contained in:
Roberto Raggi
2008-12-03 14:28:33 +01:00
parent 2a76e5f85e
commit e02f818f84

View File

@@ -91,7 +91,8 @@ Document::Ptr TypeOfExpression::documentForExpression(const QString &expression)
{
// create the expression's AST.
Document::Ptr doc = Document::create(QLatin1String("<completion>"));
doc->setSource(expression.toUtf8());
const QByteArray bytes = expression.toUtf8();
doc->setSource(bytes);
doc->parse(Document::ParseExpression);
return doc;
}