Skip to content

Commit

Permalink
Gui: [skip ci] fix regression in Document::setEdit()
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Feb 25, 2020
1 parent d222f7b commit fba86d1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Gui/Document.cpp
Expand Up @@ -287,6 +287,14 @@ bool Document::setEdit(Gui::ViewProvider* p, int ModNum, const char *subname)
FC_ERR("cannot edit non ViewProviderDocumentObject");
return false;
}

// Fix regression: https://forum.freecadweb.org/viewtopic.php?f=19&t=43629&p=371972#p371972
// When an object is already in edit mode a subsequent call for editing is only possible
// when resetting the currently edited object.
if (d->_editViewProvider) {
_resetEdit();
}

auto obj = vp->getObject();
if(!obj->getNameInDocument()) {
FC_ERR("cannot edit detached object");
Expand Down

0 comments on commit fba86d1

Please sign in to comment.