DAG: Add method hasRecord() and use it in Model::slotChangeObject
to avoid a possible failing assert(). Fixes #17572
This commit is contained in:
@@ -308,15 +308,21 @@ void Model::slotChangeObject(const ViewProviderDocumentObject &VPDObjectIn, cons
|
||||
//renaming of objects.
|
||||
if (std::string("Label") == name)
|
||||
{
|
||||
const GraphLinkRecord &record = findRecord(&VPDObjectIn, *graphLink);
|
||||
auto text = (*theGraph)[record.vertex].text.get();
|
||||
text->setPlainText(QString::fromUtf8(record.DObject->Label.getValue()));
|
||||
if (hasRecord(&VPDObjectIn, *graphLink))
|
||||
{
|
||||
const GraphLinkRecord &record = findRecord(&VPDObjectIn, *graphLink);
|
||||
auto text = (*theGraph)[record.vertex].text.get();
|
||||
text->setPlainText(QString::fromUtf8(record.DObject->Label.getValue()));
|
||||
}
|
||||
}
|
||||
else if (propertyIn.isDerivedFrom(App::PropertyLinkBase::getClassTypeId()))
|
||||
{
|
||||
const GraphLinkRecord &record = findRecord(&VPDObjectIn, *graphLink);
|
||||
boost::clear_vertex(record.vertex, *theGraph);
|
||||
graphDirty = true;
|
||||
if (hasRecord(&VPDObjectIn, *graphLink))
|
||||
{
|
||||
const GraphLinkRecord &record = findRecord(&VPDObjectIn, *graphLink);
|
||||
boost::clear_vertex(record.vertex, *theGraph);
|
||||
graphDirty = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user