[Uml-devel] KDE/kdesdk/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Fri Apr 20 21:17:21 UTC 2007
SVN commit 656285 by okellogg:
merge r655114:656062 from branches/KDE/3.5/kdesdk
M +4 -0 ChangeLog
M +29 -8 umbrello/codeimport/import_utils.cpp
M +10 -2 umbrello/codeimport/import_utils.h
M +1 -1 umbrello/umlview.cpp
M +5 -4 umbrello/umlwidget.cpp
--- trunk/KDE/kdesdk/umbrello/ChangeLog #656284:656285
@@ -13,8 +13,10 @@
* Crash on adding operation to class with Advanced Code Generators enabled (131528)
* Javascript wrong Code Generation (135527)
* Javascript Code Generation creates bad format methods (135540)
+* Sequence diagram object size incorrect after toggling "Draw as Actor" (136869)
* Incorrect Association Properties text (139872)
* Buttons are not displayed (139913)
+* Impossible to reuse same use case in a use case diagram (140150)
* Java 5 generics support (140669)
* Associations not updated during move of class on diagram (140709)
* Crash when deleting the link between a package and a class (141602)
@@ -30,6 +32,8 @@
* Crash on changing multiplicity in an association in ERD (143909)
* Class diagram in folder not loaded correctly from xmi (144119)
* Sequence diagram crashes during message inserting (144293)
+* No synchronisation of comments when round-tripping (144346)
+* Crash when loading xmi with actor as object of sequence diagram (144442)
Version 1.5.61
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/import_utils.cpp #656284:656285
@@ -23,7 +23,6 @@
#include "../umllistview.h"
#include "../umllistviewitem.h"
#include "../umlobject.h"
-#include "../docwindow.h"
#include "../package.h"
#include "../folder.h"
#include "../enum.h"
@@ -244,7 +243,6 @@
QString strippedComment = formatComment(comment);
if (! strippedComment.isEmpty()) {
o->setDoc(strippedComment);
- UMLApp::app()->getDocWindow()->showDocumentation(o, true);
}
if (!stereotype.isEmpty()) {
o->setStereotype(stereotype);
@@ -304,7 +302,6 @@
QString strippedComment = formatComment(comment);
if (! strippedComment.isEmpty()) {
attr->setDoc(strippedComment);
- UMLApp::app()->getDocWindow()->showDocumentation(attr, true);
}
UMLApp::app()->getDocument()->setModified(true);
@@ -329,7 +326,7 @@
comment, isStatic);
}
-void insertMethod(UMLClassifier *klass, UMLOperation *op,
+void insertMethod(UMLClassifier *klass, UMLOperation* &op,
Uml::Visibility scope, const QString& type,
bool isStatic, bool isAbstract,
bool isFriend, bool isConstructor,
@@ -362,14 +359,38 @@
if (isConstructor)
op->setStereotype("constructor");
- klass->addOperation(op);
- //umldoc->signalUMLObjectCreated(op);
QString strippedComment = formatComment(comment);
if (! strippedComment.isEmpty()) {
op->setDoc(strippedComment);
- UMLApp::app()->getDocWindow()->showDocumentation(op, true);
}
- //setModified(true);
+
+ UMLAttributeList params = op->getParmList();
+ UMLOperation *exist = klass->checkOperationSignature(op->getName(), params);
+ if (exist) {
+ // copy contents to existing operation
+ exist->setVisibility(scope);
+ exist->setStatic(isStatic);
+ exist->setAbstract(isAbstract);
+ if (! strippedComment.isEmpty())
+ exist->setDoc(strippedComment);
+ UMLAttributeList exParams = exist->getParmList();
+ UMLAttribute *param, *exParam = exParams.first();
+ for (UMLAttributeListIt it(params); (param = it.current()) != NULL;
+ ++it, exParam = exParams.next()) {
+ exParam->setName(param->getName());
+ exParam->setVisibility(param->getVisibility());
+ exParam->setStatic(param->getStatic());
+ exParam->setAbstract(param->getAbstract());
+ exParam->setDoc(param->getDoc());
+ exParam->setInitialValue(param->getInitialValue());
+ exParam->setParmKind(param->getParmKind());
+ }
+ // delete incoming UMLOperation and pass out the existing one
+ delete op;
+ op = exist;
+ } else {
+ klass->addOperation(op);
+ }
}
UMLAttribute* addMethodParameter(UMLOperation *method,
--- trunk/KDE/kdesdk/umbrello/umbrello/codeimport/import_utils.h #656284:656285
@@ -93,9 +93,17 @@
UMLOperation* makeOperation(UMLClassifier *parent, const QString &name);
/**
- * Insert the UMLOperation into the document.
+ * Insert the UMLOperation into the given classifier.
+ *
+ * @param klass The classifier into which the operation shall be added.
+ * @param op Reference to pointer to the temporary UMLOperation
+ * for insertion. The caller relinquishes ownership of the
+ * object pointed to. If an UMLOperation of same signature
+ * already exists at the classifier then the incoming
+ * UMLOperation is deleted and the pointer is set to the
+ * existing UMLOperation.
*/
- void insertMethod(UMLClassifier *klass, UMLOperation *op,
+ void insertMethod(UMLClassifier *klass, UMLOperation* &op,
Uml::Visibility scope, const QString& type,
bool isStatic, bool isAbstract,
bool isFriend = false, bool isConstructor = false,
--- trunk/KDE/kdesdk/umbrello/umbrello/umlview.cpp #656284:656285
@@ -580,7 +580,7 @@
bool bAccept = true;
switch (diagramType) {
case dt_UseCase:
- if (widgetOnDiagram(id) ||
+ if ((widgetOnDiagram(id) && ot == ot_Actor) ||
(ot != ot_Actor && ot != ot_UseCase))
bAccept = false;
break;
--- trunk/KDE/kdesdk/umbrello/umbrello/umlwidget.cpp #656284:656285
@@ -491,9 +491,6 @@
}
bool UMLWidget::activate(IDChangeLog* /*ChangeLog = 0 */) {
- setFont( m_Font );
- setSize( getWidth(), getHeight() );
- m_bActivated = true;
if (widgetHasUMLObject(m_Type) && m_pObject == NULL) {
m_pObject = m_pDoc->findObjectById(m_nId);
if (m_pObject == NULL) {
@@ -502,6 +499,9 @@
return false;
}
}
+ setFont(m_Font);
+ setSize(getWidth(), getHeight());
+ m_bActivated = true;
updateComponentSize();
if( m_pView -> getPastePoint().x() != 0 ) {
FloatingTextWidget * ft = 0;
@@ -851,7 +851,8 @@
const QSize minSize = calculateSize();
const int w = minSize.width();
const int h = minSize.height();
- if (m_Type != Uml::wt_ForkJoin && getWidth() >= w && getHeight() >= h)
+ if (m_Type != Uml::wt_ForkJoin && m_Type != Uml::wt_Object &&
+ getWidth() >= w && getHeight() >= h)
return;
setSize(w, h);
adjustAssocs( getX(), getY() ); // adjust assoc lines
More information about the umbrello-devel
mailing list