copyObject should return the clone of the passed object for recursive copies, not an arbitrary object

This commit is contained in:
wmayer
2019-02-12 19:40:29 +01:00
parent 6e5564707b
commit 7778f25584

View File

@@ -3047,6 +3047,11 @@ DocumentObject* Document::copyObject(DocumentObject* obj, bool recursive)
md.setVerbose(recursive);
if (recursive) {
objs = obj->getDocument()->getDependencyList(objs);
auto it = std::find(objs.begin(), objs.end(), obj);
if (it != objs.end()) {
auto index = std::distance(objs.begin(), it);
std::swap(objs[index], objs.back());
}
}
unsigned int memsize=1000; // ~ for the meta-information