+ disallow duplicates of external constraints
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5355 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
parent
3e939999c4
commit
b755192047
|
@ -1042,6 +1042,13 @@ int SketchObject::addExternal(App::DocumentObject *Obj, const char* SubName)
|
|||
std::vector<DocumentObject*> originalObjects = Objects;
|
||||
std::vector<std::string> originalSubElements = SubElements;
|
||||
|
||||
std::vector<std::string> ::iterator it;
|
||||
it = std::find(originalSubElements.begin(), originalSubElements.end(), SubName);
|
||||
|
||||
// avoid duplicates
|
||||
if (it != originalSubElements.end())
|
||||
return -1;
|
||||
|
||||
// add the new ones
|
||||
Objects.push_back(Obj);
|
||||
SubElements.push_back(std::string(SubName));
|
||||
|
|
Loading…
Reference in New Issue
Block a user