fix crash when creating a copy of datum object

This commit is contained in:
wmayer
2018-09-29 12:34:55 +02:00
parent 66e46c9a37
commit c2d97241ee

View File

@@ -363,7 +363,9 @@ App::DocumentObject* TaskFeaturePick::makeCopy(App::DocumentObject* obj, std::st
// TODO Replace it with commands (2015-09-11, Fat-Zer)
if(obj->isDerivedFrom(Part::Datum::getClassTypeId())) {
copy = App::GetApplication().getActiveDocument()->addObject(
obj->getClassTypeId().getName(), name.c_str() );
obj->getTypeId().getName(), name.c_str() );
assert(copy->isDerivedFrom(Part::Datum::getClassTypeId()));
//we need to reference the individual datums and make again datums. This is important as
//datum adjust their size dependent on the part size, hence simply copying the shape is