[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Thu Jun 3 15:06:01 UTC 2004


CVS commit by okellogg: 

operator==(): Consider local IDs in the wt_Object case.


  M +16 -0     associationwidget.cpp   1.100


--- kdesdk/umbrello/umbrello/associationwidget.cpp  #1.99:1.100
@@ -202,4 +202,20 @@ bool AssociationWidget::operator==(Assoc
                 return false;
 
+        if (getWidgetA()->getBaseType() == Uml::wt_Object &&
+            Other.getWidgetA()->getBaseType() == Uml::wt_Object) {
+                ObjectWidget *ownA = static_cast<ObjectWidget*>(getWidgetA());
+                ObjectWidget *otherA = static_cast<ObjectWidget*>(Other.getWidgetA());
+                if (ownA->getLocalID() != otherA->getLocalID())
+                        return false;
+        }
+
+        if (getWidgetB()->getBaseType() == Uml::wt_Object &&
+            Other.getWidgetB()->getBaseType() == Uml::wt_Object) {
+                ObjectWidget *ownB = static_cast<ObjectWidget*>(getWidgetB());
+                ObjectWidget *otherB = static_cast<ObjectWidget*>(Other.getWidgetB());
+                if (ownB->getLocalID() != otherB->getLocalID())
+                        return false;
+        }
+
         return true;
 }






More information about the umbrello-devel mailing list