Commit 845948cd authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner: crash fix

See BAUHAUS-435
Inside a modification group/transaction we disable undo/redo
parent 4bd8b477
......@@ -748,12 +748,14 @@ RewriterView *DesignDocumentController::rewriterView() const
void DesignDocumentController::undo()
{
m_d->textEdit->undo();
if (m_d->rewriterView && !m_d->rewriterView->modificationGroupActive())
m_d->textEdit->undo();
}
void DesignDocumentController::redo()
{
m_d->textEdit->redo();
if (m_d->rewriterView && !m_d->rewriterView->modificationGroupActive())
m_d->textEdit->redo();
}
#ifdef ENABLE_TEXT_VIEW
......
......@@ -153,6 +153,7 @@ public:
int nodeLength(const ModelNode &node) const;
int firstDefinitionInsideOffset(const ModelNode &node) const;
int firstDefinitionInsideLength(const ModelNode &node) const;
bool modificationGroupActive();
signals:
void errorsChanged(const QList<RewriterView::Error> &errors);
......
......@@ -484,6 +484,11 @@ int RewriterView::firstDefinitionInsideLength(const ModelNode &node) const
return objectLengthCalculator(offset);
}
bool RewriterView::modificationGroupActive()
{
return m_modificationGroupActive;
}
void RewriterView::qmlTextChanged()
{
if (inErrorState())
......
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