Commit 3497f037 authored by Kai Koehne's avatar Kai Koehne

Fix crash for long properties in outline model

Make sure the outline model only shows the first line
of a long property value.

Change-Id: Iac8059e927b10c400afec285a6dc6485cbbf49b4
Reviewed-by: default avatarFawzi Mohamed <fawzi.mohamed@digia.com>
parent e2b00f5c
......@@ -963,8 +963,11 @@ QString QmlOutlineModel::getAnnotation(AST::ExpressionNode *expression)
if (!expression)
return QString();
QString source = m_semanticInfo.document->source();
return source.mid(expression->firstSourceLocation().begin(),
expression->lastSourceLocation().end() - expression->firstSourceLocation().begin());
QString str = source.mid(expression->firstSourceLocation().begin(),
expression->lastSourceLocation().end()
- expression->firstSourceLocation().begin());
// only show first line
return str.left(str.indexOf(QLatin1Char('\n')));
}
QHash<QString,QString> QmlOutlineModel::getScriptBindings(AST::UiObjectInitializer *objectInitializer) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment