diff options
Diffstat (limited to 'src/uml/qumlconstraint.cpp')
-rw-r--r-- | src/uml/qumlconstraint.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/uml/qumlconstraint.cpp b/src/uml/qumlconstraint.cpp index 78beab37..467bec8e 100644 --- a/src/uml/qumlconstraint.cpp +++ b/src/uml/qumlconstraint.cpp @@ -75,6 +75,14 @@ QUmlConstraint::QUmlConstraint(bool createQModelingObject) : } /*! + Destroys the QUmlConstraint. + */ +QUmlConstraint::~QUmlConstraint() +{ + QModelingElement::deleteQModelingObject(); +} + +/*! Returns a deep-copied clone of the QUmlConstraint. */ QModelingElement *QUmlConstraint::clone() const @@ -82,20 +90,10 @@ QModelingElement *QUmlConstraint::clone() const QUmlConstraint *c = new QUmlConstraint; foreach (QUmlComment *element, ownedComments()) c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone())); - if (owningTemplateParameter()) - c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone())); - if (templateParameter()) - c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone())); - foreach (QUmlDependency *element, clientDependencies()) - c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone())); c->setName(name()); if (nameExpression()) c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone())); c->setVisibility(visibility()); - foreach (QUmlElement *element, constrainedElements()) - c->addConstrainedElement(dynamic_cast<QUmlElement *>(element->clone())); - if (context()) - c->setContext(dynamic_cast<QUmlNamespace *>(context()->clone())); if (specification()) c->setSpecification(dynamic_cast<QUmlValueSpecification *>(specification()->clone())); return c; |