[Uml-devel] [Bug 107134] Copy/Paste produce invalid diagrams
Oliver Kellogg
okellogg at users.sourceforge.net
Fri Jun 10 14:40:39 UTC 2005
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=107134
------- Additional Comments From okellogg users sourceforge net 2005-06-10 23:37 -------
SVN commit 424123 by okellogg:
After a "Duplicate" on a class with attributes and/or operations the duplicated
class was missing its atts/ops in the list view. Here's the fix for that.
CCBUG:107134
M +5 -1 classifier.cpp
M +7 -0 classifier.h
M +13 -2 umlwidget.cpp
--- trunk/KDE/kdesdk/umbrello/umbrello/classifier.cpp #424122:424123
@ -65,6 +65,10 @
return (m_BaseType == ot_Interface);
}
+void UMLClassifier::signalChildObjectAdded(UMLClassifierListItem *childObj) {
+ emit childObjectAdded(childObj);
+}
+
UMLOperation * UMLClassifier::checkOperationSignature( QString name,
UMLAttributeList *opParams,
UMLOperation *exemptOp)
@ -626,7 +630,7 @
UMLClassifierListItemList resultList;
for (UMLClassifierListItemListIt lit(m_List); lit.current(); ++lit) {
UMLClassifierListItem *listItem = lit.current();
- if (listItem->getBaseType() == ot)
+ if (ot == Uml::ot_UMLObject || listItem->getBaseType() == ot)
resultList.append(listItem);
}
return resultList;
--- trunk/KDE/kdesdk/umbrello/umbrello/classifier.h #424122:424123
@ -341,6 +341,8 @
/**
* Returns the entries in m_List that are of the requested type.
+ * If the requested type is Uml::ot_UMLObject then all entries
+ * are returned.
*
* return The list of true operations for the Concept.
*/
@ -432,6 +434,11 @
*/
bool hasAbstractOps ();
+ /**
+ * Emit the UMLObject::childObjectAdded signal for the given child object.
+ */
+ void signalChildObjectAdded(UMLClassifierListItem *childObj);
+
signals:
/** Signals that a new UMLOperation has been added to the classifer.
* The signal is emitted in addition to the generic childObjectAdded()
--- trunk/KDE/kdesdk/umbrello/umbrello/umlwidget.cpp #424122:424123
@ -24,7 +24,7 @
#include "umldoc.h"
#include "umllistview.h"
#include "umlview.h"
-
+#include "umlclassifierlistitemlist.h"
#include "codegenerator.h"
#include "codegenerators/simplecodegenerator.h"
#include "listpopupmenu.h"
@ -542,7 +542,18 @
case ListPopupMenu::mt_Clone:
// In principle we clone all the uml objects.
- m_pView->addObject(m_pObject->clone());
+ {
+ UMLObject *pClone = m_pObject->clone();
+ m_pView->addObject(pClone);
+ if (dynamic_cast<UMLClassifier*>(pClone)) {
+ UMLClassifier *c = static_cast<UMLClassifier*>(pClone);
+ UMLClassifierListItemList items = c->getFilteredList(Uml::ot_UMLObject);
+ for (UMLClassifierListItemListIt it(items); it.current(); ++it) {
+ UMLClassifierListItem *item = it.current();
+ c->signalChildObjectAdded(item);
+ }
+ }
+ }
break;
case ListPopupMenu::mt_Rename_MultiA:
More information about the umbrello-devel
mailing list