prepare view provider for undo/redo

This commit is contained in:
wmayer
2016-06-20 14:00:47 +02:00
parent 9ec06b47c6
commit 0f2db9061f
4 changed files with 43 additions and 16 deletions

View File

@@ -94,10 +94,12 @@ const char* ViewProviderDocumentObject::detachFromDocument()
void ViewProviderDocumentObject::onBeforeChange(const App::Property* prop)
{
App::DocumentObject* obj = getObject();
App::Document* doc = obj ? obj->getDocument() : 0;
if (doc) {
onBeforeChangeProperty(doc, prop);
if (isAttachedToDocument()) {
App::DocumentObject* obj = getObject();
App::Document* doc = obj ? obj->getDocument() : 0;
if (doc) {
onBeforeChangeProperty(doc, prop);
}
}
}