ModelEditor: Fix coverity findings

Change-Id: I40d58ce3e5040dc083bbcd27cc6481510ae41f95
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Jochen Becher
2017-07-27 19:15:47 +02:00
parent 34de70c270
commit 712297cbf0

View File

@@ -150,7 +150,7 @@ void DFlatAssignmentVisitor::visitDConnection(const DConnection *connection)
{ {
visitDRelation(connection); visitDRelation(connection);
auto target = dynamic_cast<DConnection *>(m_target); auto target = dynamic_cast<DConnection *>(m_target);
QMT_CHECK(target); QMT_ASSERT(target, return);
target->setCustomRelationId(connection->customRelationId()); target->setCustomRelationId(connection->customRelationId());
target->setEndA(connection->endA()); target->setEndA(connection->endA());
target->setEndB(connection->endB()); target->setEndB(connection->endB());
@@ -160,6 +160,7 @@ void DFlatAssignmentVisitor::visitDAnnotation(const DAnnotation *annotation)
{ {
visitDElement(annotation); visitDElement(annotation);
auto target = dynamic_cast<DAnnotation *>(m_target); auto target = dynamic_cast<DAnnotation *>(m_target);
QMT_ASSERT(target, return);
target->setText(annotation->text()); target->setText(annotation->text());
target->setPos(annotation->pos()); target->setPos(annotation->pos());
target->setRect(annotation->rect()); target->setRect(annotation->rect());
@@ -171,6 +172,7 @@ void DFlatAssignmentVisitor::visitDBoundary(const DBoundary *boundary)
{ {
visitDElement(boundary); visitDElement(boundary);
auto target = dynamic_cast<DBoundary *>(m_target); auto target = dynamic_cast<DBoundary *>(m_target);
QMT_ASSERT(target, return);
target->setText(boundary->text()); target->setText(boundary->text());
target->setPos(boundary->pos()); target->setPos(boundary->pos());
target->setRect(boundary->rect()); target->setRect(boundary->rect());