[Uml-devel] kdesdk/umbrello/umbrello/diagram

Dirk Mueller mueller at kde.org
Thu Mar 20 08:52:10 UTC 2003


CVS commit by mueller: 

reverting my last "compile fix". the problem was in front of the computer..


  M +9 -7      widgetfactory.cpp   1.8


--- kdesdk/umbrello/umbrello/diagram/widgetfactory.cpp  #1.7:1.8
@@ -43,19 +43,21 @@ DiagramElement* WidgetFactory:: createUM
         int id = parent->document()->getUniqueID();
         
-        if ( dynamic_cast<UMLClass*>( obj ) )
-                w = new ClassWidget(parent,id,static_cast<UMLClass*>(obj));
-        else if ( dynamic_cast<UMLInterface*>( obj ) ) 
+        type_info &type = typeid(*obj);
+        if( type == typeid(UMLClass) )
+        {
+                w = new ClassWidget(parent,id,dynamic_cast<UMLClass*>(obj));
+        }
+        else if ( type == typeid(UMLInterface) )
         {
         //      w = new InterfaceWidget(parent,id,dynamic_cast<UMLInterface*>(obj));
         }
-        else if ( dynamic_cast<UMLActor*> ( obj ) )
+        else if ( type == typeid(UMLActor) )
         {
-                w = new ActorWidget(parent,id,static_cast<UMLActor*>(obj));
+                w = new ActorWidget(parent,id,dynamic_cast<UMLActor*>(obj));
         }
         //else if ( type == typeid(...) )
         else
         {
-                kdDebug()<<"Widget fot type "
-                    << typeid( *obj ).name() << " not yet implemented"<<endl;
+                kdDebug()<<"Widget fot type "<<type.name()<<" not yet implemented"<<endl;
         }
         return w;






More information about the umbrello-devel mailing list