[Uml-devel] KDE/kdesdk/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Mon Jun 11 19:22:16 UTC 2007
SVN commit 674109 by okellogg:
sync with branches/KDE/3.5 (672632:674103)
M +5 -0 ChangeLog
M +2 -0 THANKS
M +1 -1 VERSION
M +2 -0 umbrello/associationwidget.cpp
M +1 -1 umbrello/classifierlistitem.h
M +2 -2 umbrello/codegenerators/pascalwriter.cpp
M +21 -4 umbrello/operation.cpp
M +11 -3 umbrello/operation.h
--- trunk/KDE/kdesdk/umbrello/ChangeLog #674108:674109
@@ -1,3 +1,8 @@
+Version 1.5.72
+
+* Bugs/wishes from http://bugs.kde.org:
+* Wrong pascal code generation (146676)
+
Version 1.5.71
* Bugs/wishes from http://bugs.kde.org:
--- trunk/KDE/kdesdk/umbrello/THANKS #674108:674109
@@ -49,6 +49,8 @@
Piotr Kolaczkowski <P.Kolaczkowski @elka.pw.edu.pl>
Matthias Kretz <kretz @kde.org>
Thorsten Kunz <tk @bytecrash.net>
+Dmitry N. Kurashkin <dkur @nm.ru>
+Jari-Matti Mäkelä <jmjm @iki.fi>
Gustavo Madrigal <gmadrigal @nextphere.com>
martin <mv123q3 @hotmail.com>
Rene Meyer <Rene.Meyer @sturmit.de>
--- trunk/KDE/kdesdk/umbrello/VERSION #674108:674109
@@ -1 +1 @@
-1.80.4
+1.90.2
--- trunk/KDE/kdesdk/umbrello/umbrello/associationwidget.cpp #674108:674109
@@ -340,6 +340,8 @@
m_pName->setActivated();
m_pView->addWidget(m_pName);
}
+
+ m_pName->show();
}
void AssociationWidget::setFloatingText(Uml::Text_Role tr,
--- trunk/KDE/kdesdk/umbrello/umbrello/classifierlistitem.h #674108:674109
@@ -91,7 +91,7 @@
*
* @param type Pointer to the UMLObject of the type.
*/
- void setType(UMLObject *type);
+ virtual void setType(UMLObject *type);
/**
* Returns a string representation of the list item.
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/pascalwriter.cpp #674108:674109
@@ -241,7 +241,7 @@
UMLClassifierList superclasses = c->getSuperClasses();
- pas << getIndent() << "TObject = object";
+ pas << getIndent() << classname << " = object";
if (!superclasses.isEmpty()) {
// FIXME: Multiple inheritance is not yet supported
UMLClassifier* parent = superclasses.first();
@@ -312,7 +312,7 @@
}
pas << getIndent() << "end;" << m_endl << m_endl;
- pas << getIndent() << "PObject = ^TObject;" << m_endl << m_endl;
+ pas << getIndent() << "P" << classname << " = ^" << classname <<";" << m_endl << m_endl;
m_indentLevel--;
pas << "end;" << m_endl << m_endl;
--- trunk/KDE/kdesdk/umbrello/umbrello/operation.cpp #674108:674109
@@ -26,11 +26,14 @@
#include "dialogs/umloperationdialog.h"
UMLOperation::UMLOperation(const UMLClassifier *parent, const QString& name,
- Uml::IDType id, Uml::Visibility s, const QString& rt)
+ Uml::IDType id, Uml::Visibility s, UMLObject *rt)
: UMLClassifierListItem(parent, name, id)
{
- if (!rt.isEmpty())
- setTypeName( rt );
+ if (rt)
+ m_returnId = UniqueID::gen();
+ else
+ m_returnId = Uml::id_None;
+ m_pSecondary = rt;
m_Vis = s;
m_BaseType = Uml::ot_Operation;
m_bConst = false;
@@ -46,6 +49,12 @@
UMLOperation::~UMLOperation() {
}
+void UMLOperation::setType(UMLObject *type) {
+ UMLClassifierListItem::setType(type);
+ if (m_returnId == Uml::id_None)
+ m_returnId = UniqueID::gen();
+}
+
void UMLOperation::moveParmLeft(UMLAttribute * a) {
if (a == NULL) {
kDebug() << "UMLOperation::moveParmLeft called on NULL attribute"
@@ -281,7 +290,12 @@
QDomElement featureElement = qDoc.createElement( "UML:BehavioralFeature.parameter" );
if (m_pSecondary) {
QDomElement retElement = qDoc.createElement("UML:Parameter");
- retElement.setAttribute( "xmi.id", ID2STR(UniqueID::gen()) );
+ if (m_returnId == Uml::id_None) {
+ kDebug() << "UMLOperation::saveToXMI(" << m_Name
+ << "): m_returnId is not set, setting it now." << endl;
+ m_returnId = UniqueID::gen();
+ }
+ retElement.setAttribute( "xmi.id", ID2STR(m_returnId) );
retElement.setAttribute( "type", ID2STR(m_pSecondary->getID()) );
retElement.setAttribute( "kind", "return" );
featureElement.appendChild( retElement );
@@ -353,6 +367,9 @@
}
}
if (kind == "return") {
+ QString returnId = attElement.attribute("xmi.id", "");
+ if (!returnId.isEmpty())
+ m_returnId = STR2ID(returnId);
m_SecondaryId = attElement.attribute( "type", "" );
if (m_SecondaryId.isEmpty()) {
// Perhaps the type is stored in a child node:
--- trunk/KDE/kdesdk/umbrello/umbrello/operation.h #674108:674109
@@ -40,7 +40,7 @@
UMLOperation(const UMLClassifier * parent, const QString& name,
Uml::IDType id = Uml::id_None,
Uml::Visibility s = Uml::Visibility::Public,
- const QString& rt = QString());
+ UMLObject *rt = 0);
/**
* Constructs an UMLOperation.
@@ -75,6 +75,13 @@
virtual UMLObject* clone() const;
/**
+ * Reimplement method from UMLClassifierListItem.
+ *
+ * @param type Pointer to the type object.
+ */
+ void setType(UMLObject *type);
+
+ /**
* Move a parameter one position to the left.
*
* @param a The parameter to move.
@@ -194,8 +201,9 @@
bool load( QDomElement & element );
private:
- UMLAttributeList m_List;
- bool m_bConst;
+ Uml::IDType m_returnId; ///< Holds the xmi.id of the <UML:Parameter kind="return">
+ UMLAttributeList m_List; /// Parameter list
+ bool m_bConst; ///< Holds the isQuery attribute of the <UML:Operation>
};
#endif
More information about the umbrello-devel
mailing list