Bug 129252

Summary: crash when click in an empty zone of the list view when the context menu is displayed
Product: [Applications] umbrello Reporter: Gaël de Chalendar (aka Kleag) <kleagg>
Component: generalAssignee: Umbrello Development Group <umbrello-devel>
Status: RESOLVED FIXED    
Severity: crash CC: greatbunzinni
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Patch that solves the crash

Description Gaël de Chalendar (aka Kleag) 2006-06-16 15:02:34 UTC
Version:           3.5.3 (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc (GCC) 4.0.1  (4.0.1-5mdk for Mandriva Linux release 2006.0)
OS:                Linux

All is said in the short description... Patch will be attached.
Comment 1 Gaël de Chalendar (aka Kleag) 2006-06-16 15:05:26 UTC
Created attachment 16639 [details]
Patch that solves the crash

No sure if is the good solution to consider a null item (click on nothing) as a
lvt_Unknown
Comment 2 Oliver Kellogg 2006-06-16 17:14:26 UTC
*** Bug 126560 has been marked as a duplicate of this bug. ***
Comment 3 Oliver Kellogg 2006-06-16 19:48:16 UTC
SVN commit 552136 by okellogg:

Make proper Uml::ListView_Type lvt_EnumLiteral.
BUG:129252


 M  +1 -0      ChangeLog  
 M  +4 -0      umbrello/listpopupmenu.cpp  
 M  +11 -7     umbrello/umllistview.cpp  
 M  +1 -0      umbrello/umlnamespace.h  


--- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #552135:552136
@@ -2,6 +2,7 @@
 
 * Bugs/wishes from http://bugs.kde.org:
 * Fix crash when importing classes from a java file (129107)
+* Crash after single click on the "UML Model" tree window (126560/129252)
 
 Version 1.5.3
 
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/listpopupmenu.cpp #552135:552136
@@ -165,6 +165,10 @@
         mt = mt_Enum;
         break;
 
+    case Uml::lvt_EnumLiteral:
+        mt = mt_EnumLiteral;
+        break;
+
     case Uml::lvt_Datatype:
         mt = mt_Datatype;
         break;
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umllistview.cpp #552135:552136
@@ -192,7 +192,7 @@
         case Uml::lvt_EntityAttribute:
         case Uml::lvt_Operation:
         case Uml::lvt_Template:
-        case Uml::lvt_Unknown:  // used for EnumLiteral
+        case Uml::lvt_EnumLiteral:
             UMLApp::app() -> getDocWindow() -> showDocumentation( item -> getUMLObject(), false );
             break;
 
@@ -1565,7 +1565,7 @@
     case Uml::lvt_EntityAttribute:
     case Uml::lvt_Operation:
     case Uml::lvt_Template:
-    case Uml::lvt_Unknown:  // used for EnumLiteral
+    case Uml::lvt_EnumLiteral:
         {
             UMLClassifier *pClass =  static_cast<UMLClassifier*>(parent->getUMLObject());
             Uml::IDType newID = IDChanges.findNewID( Data.getID() );
@@ -1741,6 +1741,10 @@
         type = Uml::lvt_Enum;
         break;
 
+    case Uml::ot_EnumLiteral:
+        type = Uml::lvt_EnumLiteral;
+        break;
+
     case Uml::ot_Entity:
         type = Uml::lvt_Entity;
         break;
@@ -1830,7 +1834,7 @@
         ot = Uml::ot_Template;
         break;
 
-    case Uml::lvt_Unknown:   // @todo make a proper lvt_EnumLiteral
+    case Uml::lvt_EnumLiteral:
         ot = Uml::ot_EnumLiteral;
         break;
 
@@ -2376,7 +2380,7 @@
     case Uml::lvt_EntityAttribute:
     case Uml::lvt_Operation:
     case Uml::lvt_Template:
-    case Uml::lvt_Unknown:  // used for EnumLiteral
+    case Uml::lvt_EnumLiteral:
         return createChildUMLObject( renamedItem, convert_LVT_OT(type) );
         break;
 
@@ -2681,7 +2685,7 @@
     case Uml::lvt_Attribute:
     case Uml::lvt_EntityAttribute:
     case Uml::lvt_Operation:
-    case Uml::lvt_Unknown:  // used for EnumLiteral
+    case Uml::lvt_EnumLiteral:
         {
             UMLClassifier *parent = static_cast<UMLClassifier*>(parentItem->getUMLObject());
             return (parent->findChildObject(name) == NULL);
@@ -2851,7 +2855,7 @@
         case Uml::lvt_EntityAttribute:
         case Uml::lvt_Template:
         case Uml::lvt_Operation:
-        case Uml::lvt_Unknown:  // used for EnumLiteral
+        case Uml::lvt_EnumLiteral:
             item = findItem(nID);
             if (item == NULL) {
                 kdDebug() << "UMLListView::loadChildrenFromXMI: "
@@ -3032,7 +3036,7 @@
         type == Uml::lvt_Operation ||
         type == Uml::lvt_Template ||
         type == Uml::lvt_EntityAttribute ||
-        type == Uml::lvt_Unknown) {  // used for enum literal
+        type == Uml::lvt_EnumLiteral) {
         return true;
     } else {
         return false;
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umlnamespace.h #552135:552136
@@ -204,6 +204,7 @@
     lvt_EntityRelationship_Model,
     lvt_Subsystem,
     lvt_Model,
+    lvt_EnumLiteral,
     lvt_Unknown = -1
 };