Commit c91a4bf9 authored by Ralf Habacker's avatar Ralf Habacker
Browse files

Do not write unrelated xmi attributes for instance widgets.

Instance widgets are written by class ClassifierWidget which wrotes
several unrelated 'show...' attributes in that case.
parent 509d7a2c
...@@ -1337,27 +1337,29 @@ bool ClassifierWidget::loadFromXMI1(QDomElement & qElement) ...@@ -1337,27 +1337,29 @@ bool ClassifierWidget::loadFromXMI1(QDomElement & qElement)
void ClassifierWidget::saveToXMI1(QDomDocument & qDoc, QDomElement & qElement) void ClassifierWidget::saveToXMI1(QDomDocument & qDoc, QDomElement & qElement)
{ {
QDomElement conceptElement; QDomElement conceptElement;
bool saveShowAttributes = true;
UMLClassifier *umlc = classifier(); UMLClassifier *umlc = classifier();
if (umlObject() && umlObject()->baseType() == UMLObject::ot_Package) { if (umlObject() && umlObject()->baseType() == UMLObject::ot_Package) {
conceptElement = qDoc.createElement(QLatin1String("packagewidget")); conceptElement = qDoc.createElement(QLatin1String("packagewidget"));
UMLWidget::saveToXMI1(qDoc, conceptElement); saveShowAttributes = false;
qElement.appendChild(conceptElement); } else if(umlObject()->baseType() == UMLObject::ot_Instance) {
return;
}
else if (umlc && umlc->isInterface())
conceptElement = qDoc.createElement(QLatin1String("interfacewidget"));
else if(umlObject()->baseType() == UMLObject::ot_Instance)
conceptElement = qDoc.createElement(QLatin1String("instancewidget")); conceptElement = qDoc.createElement(QLatin1String("instancewidget"));
else saveShowAttributes = false;
} else if (umlc && umlc->isInterface()) {
conceptElement = qDoc.createElement(QLatin1String("interfacewidget"));
} else {
conceptElement = qDoc.createElement(QLatin1String("classwidget")); conceptElement = qDoc.createElement(QLatin1String("classwidget"));
}
UMLWidget::saveToXMI1(qDoc, conceptElement); UMLWidget::saveToXMI1(qDoc, conceptElement);
conceptElement.setAttribute(QLatin1String("showoperations"), visualProperty(ShowOperations)); if (saveShowAttributes) {
conceptElement.setAttribute(QLatin1String("showpubliconly"), visualProperty(ShowPublicOnly)); conceptElement.setAttribute(QLatin1String("showoperations"), visualProperty(ShowOperations));
conceptElement.setAttribute(QLatin1String("showopsigs"), m_operationSignature); conceptElement.setAttribute(QLatin1String("showpubliconly"), visualProperty(ShowPublicOnly));
conceptElement.setAttribute(QLatin1String("showpackage"), visualProperty(ShowPackage)); conceptElement.setAttribute(QLatin1String("showopsigs"), m_operationSignature);
conceptElement.setAttribute(QLatin1String("showscope"), visualProperty(ShowVisibility)); conceptElement.setAttribute(QLatin1String("showpackage"), visualProperty(ShowPackage));
conceptElement.setAttribute(QLatin1String("showattributes"), visualProperty(ShowAttributes)); conceptElement.setAttribute(QLatin1String("showscope"), visualProperty(ShowVisibility));
conceptElement.setAttribute(QLatin1String("showattsigs"), m_attributeSignature); conceptElement.setAttribute(QLatin1String("showattributes"), visualProperty(ShowAttributes));
conceptElement.setAttribute(QLatin1String("showattsigs"), m_attributeSignature);
}
#ifdef ENABLE_WIDGET_SHOW_DOC #ifdef ENABLE_WIDGET_SHOW_DOC
conceptElement.setAttribute(QLatin1String("showdocumentation"),visualProperty(ShowDocumentation)); conceptElement.setAttribute(QLatin1String("showdocumentation"),visualProperty(ShowDocumentation));
#endif #endif
......
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