Commit e4aaa80f authored by Ralf Habacker's avatar Ralf Habacker

Fix 'Duplicated text labels in xmi file'

BUG:403888
FIXED-IN:2.27.2 (KDE Applications 17.12.2)
parent 4bf24aa2
......@@ -186,8 +186,36 @@ public:
uWarning() << "uncatched widget position of" << w->name();
}
}
}
/**
* Check if duplicated floating text labels are in the scene and remove them
*/
void removeDuplicatedFloatingTextInstances()
{
UMLWidgetList labelsWithoutParents;
UMLWidgetList labelsWithParent;
uDebug() << "checking diagram" << p->name() << "id" << Uml::ID::toString(p->id());
foreach(UMLWidget *w, p->widgetList()) {
if (!w->isTextWidget())
continue;
if (w->parentItem())
labelsWithParent.append(w);
else
labelsWithoutParents.append(w);
}
foreach(UMLWidget *w, labelsWithoutParents) {
foreach(UMLWidget *wp, labelsWithParent) {
if (w->id() == wp->id() &&
w->localID() == wp->localID() &&
w->name() == wp->name()) {
p->removeWidgetCmd(w);
uDebug() << "removed duplicated text label" << w->name() << "id:" << Uml::ID::toString(w->id());
break;
}
}
}
}
UMLScene *p;
......@@ -3785,6 +3813,7 @@ bool UMLScene::loadFromXMI1(QDomElement & qElement)
m_d->addMissingPorts();
m_d->fixPortPositions();
}
m_d->removeDuplicatedFloatingTextInstances();
return true;
}
......
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