Set object's Restore flag while restoring the Path property.

This commit is contained in:
Markus Lampert
2017-08-20 17:20:55 -07:00
parent 533a78026a
commit 0e81583e3f
2 changed files with 18 additions and 2 deletions

View File

@@ -28,6 +28,8 @@
#endif
#include <App/DocumentObject.h>
#include <App/PropertyContainer.h>
#include <Base/Console.h>
#include <Base/Writer.h>
#include <Base/Reader.h>
@@ -124,9 +126,23 @@ void PropertyPath::SaveDocFile (Base::Writer &) const
void PropertyPath::RestoreDocFile(Base::Reader &reader)
{
App::PropertyContainer *container = getContainer();
App::DocumentObject *obj = 0;
if (container->isDerivedFrom(App::DocumentObject::getClassTypeId())) {
obj = static_cast<App::DocumentObject*>(container);
}
if (obj) {
obj->setStatus(App::ObjectStatus::Restore, true);
}
aboutToSetValue();
_Path.RestoreDocFile(reader);
hasSetValue();
if (obj) {
obj->setStatus(App::ObjectStatus::Restore, false);
}
}