make sure resetting a document while closing it works independently of the activw view

This commit is contained in:
wmayer
2019-10-01 16:37:07 +02:00
parent 11af8c8543
commit 736417989b

View File

@@ -1787,7 +1787,11 @@ bool Document::canClose (bool checkModify, bool checkLink)
if (!Gui::Control().isAllowedAlterDocument()) {
std::string name = Gui::Control().activeDialog()->getDocumentName();
if (name == this->getDocument()->getName()) {
if (this->getInEdit())
// getInEdit() only checks if the currently active MDI view is
// a 3D view and that it is in edit mode. However, when closing a
// document then the edit mode must be reset independent of the
// active view.
if (d->_editViewProvider)
this->_resetEdit();
}
}