Commit c11df4aa authored by Ralf Habacker's avatar Ralf Habacker

Fix implementation of Import_Utils::createUMLObject() parameter searchInParentPackageOnly

Really limit searching packages to the parent package if specified.
UMLDoc::findUMLObject(), which has been used here before, does not
limit the search to the provided parent package, if specified.

CCBUG:386479
parent 459fe36a
......@@ -193,14 +193,17 @@ UMLObject *createUMLObject(UMLObject::ObjectType type,
name = name.mid(2);
parentPkg = logicalView;
}
UMLObject *o = umldoc->findUMLObject(name, type, parentPkg);
bNewUMLObjectWasCreated = false;
UMLObject *o = 0;
if (searchInParentPackageOnly) {
if (o && o->umlPackage() != parentPkg) {
o = Model_Utils::findUMLObject(parentPkg->containedObjects(), name, type);
if (!o) {
o = Object_Factory::createNewUMLObject(type, name, parentPkg);
bNewUMLObjectWasCreated = true;
bPutAtGlobalScope = false;
}
} else {
o = umldoc->findUMLObject(name, type, parentPkg);
}
if (o == 0) {
// Strip possible adornments and look again.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment