Commit 8c016da9 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.contextPane: crash fix

parent 5fe94f7c
...@@ -198,11 +198,13 @@ void QmlContextPane::setProperty(const QString &propertyName, const QVariant &va ...@@ -198,11 +198,13 @@ void QmlContextPane::setProperty(const QString &propertyName, const QVariant &va
QmlJSIndenter indenter; QmlJSIndenter indenter;
indenter.setTabSize(ts.m_tabSize); indenter.setTabSize(ts.m_tabSize);
indenter.setIndentSize(ts.m_indentSize); indenter.setIndentSize(ts.m_indentSize);
QTextBlock start = m_editor->editor()->document()->findBlockByLineNumber(line); QTextBlock start = m_editor->editor()->document()->findBlockByNumber(line);
QTextBlock end = m_editor->editor()->document()->findBlockByLineNumber(line); QTextBlock end = m_editor->editor()->document()->findBlockByNumber(line);
const int indent = indenter.indentForBottomLine(m_editor->editor()->document()->begin(), end.next(), QChar::Null); if (end.isValid()) {
ts.indentLine(start, indent); const int indent = indenter.indentForBottomLine(m_editor->editor()->document()->begin(), end.next(), QChar::Null);
ts.indentLine(start, indent);
}
} }
tc.endEditBlock(); tc.endEditBlock();
tc.setPosition(cursorPostion); tc.setPosition(cursorPostion);
......
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