Skip to content

Commit

Permalink
fixes 0003341: Undoing is missing steps
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Oct 13, 2018
1 parent cb30a82 commit 571f752
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/Gui/propertyeditor/PropertyEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,15 @@ void PropertyEditor::closeEditor (QWidget * editor, QAbstractItemDelegate::EndEd
{
if (autoupdate) {
App::Document* doc = App::GetApplication().getActiveDocument();
if (doc && doc->isTouched())
doc->recompute();
if (doc) {
if (doc->isTouched()) {
doc->commitTransaction();
doc->recompute();
}
else {
doc->abortTransaction();
}
}
}
QTreeView::closeEditor(editor, hint);
}
Expand Down Expand Up @@ -140,6 +147,13 @@ void PropertyEditor::currentChanged ( const QModelIndex & current, const QModelI

void PropertyEditor::onItemActivated ( const QModelIndex & index )
{
if (autoupdate) {
PropertyItem* property = static_cast<PropertyItem*>(index.internalPointer());
QString edit = tr("Edit %1").arg(property->propertyName());
App::Document* doc = App::GetApplication().getActiveDocument();
if (doc)
doc->openTransaction(edit.toUtf8());
}
openPersistentEditor(model()->buddy(index));
}

Expand Down

0 comments on commit 571f752

Please sign in to comment.