Commit 506b58b7 authored by Oliver Kellogg's avatar Oliver Kellogg
Browse files

umbrello/uml1model/umlobject.{h,cpp} followup to commit c7fdfefc :

- Add function tags() returning reference to m_TaggedValues.
- In function loadFromXMI1 fix loading of subelement
  <UML:ModelElement.taggedValues> and nested elements <UML:TaggedValue>.

CCBUG: 73847
parent 9cee486f
......@@ -563,6 +563,13 @@ QString UMLObject::stereotype(bool includeAdornments /* = false */) const
return m_pStereotype->name(includeAdornments);
}
/**
* Returns the concrete values of stereotype attributes.
*/
QStringList & UMLObject::tags() {
return m_TaggedValues;
}
/**
* Return the package(s) in which this UMLObject is contained
* as a text.
......@@ -1092,13 +1099,15 @@ bool UMLObject::loadFromXMI1(QDomElement & element)
while (!elem.isNull()) {
QString tag = elem.tagName();
if (UMLDoc::tagEq(tag, QLatin1String("ModelElement.taggedValues"))) {
QDomNode tvNode = element.firstChild();
QDomNode tvNode = elem.firstChild();
QDomElement tvElem = tvNode.toElement();
while (!tvElem.isNull()) {
tag = tvElem.tagName();
if (UMLDoc::tagEq(tag, QLatin1String("TaggedValue"))) {
QString value = elem.attribute(QLatin1String("value"));
QString value = tvElem.attribute(QLatin1String("value"));
m_TaggedValues.append(value);
uDebug() << "loadFromXMI1(" << m_name
<< "): Loaded " << tag << " value " << value;
} else {
uDebug() << "loadFromXMI1(" << m_name
<< "): Unknown ModelElement.taggedValues child " << tag;
......
......@@ -149,6 +149,8 @@ public:
void setUMLStereotype(UMLStereotype *stereo);
UMLStereotype *umlStereotype();
QStringList& tags();
QString package(const QString& separator = QString(),
bool includeRoot = false);
......
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