Bug 138344

Summary: Umbrello - Saving trashes model, classes lost
Product: [Applications] umbrello Reporter: Allan Todd <kde>
Component: generalAssignee: Umbrello Development Group <umbrello-devel>
Status: RESOLVED WORKSFORME    
Severity: normal CC: finex
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: RedHat Enterprise Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: This is the model which I have the problem with.

Description Allan Todd 2006-12-04 14:17:25 UTC
Version:           1.5.52 (using KDE KDE 3.5.3)
Installed from:    RedHat RPMs
Compiler:          gcc version 4.0.2 20051125 (Red Hat 4.0.2-8) 
OS:                Linux

I have a an umbrello model which I have done a lot of work on. I can no longer make any changes to it as saving the model results in all of my classes being deleted from the model.
This is easily reproduced, I simply load the model, click on a diagram and save the model again. The file size drops from 1.8M to 304K and if I reload the model, all of my classes have disappeared.
I have updated to the latest version of umbrello, but this does not help.
I have put the model at this address http://www.themightystags.com/umbrello_bug/qm_model_110.xmi
Comment 1 Allan Todd 2006-12-04 14:22:35 UTC
Created attachment 18779 [details]
This is the model which I have the problem with.

Just open it, click a diagram (to make it modified) and save it again. All the
classes will disappear :(
Comment 2 Oliver Kellogg 2006-12-05 00:33:26 UTC
SVN commit 610682 by okellogg:

resolveRef(): Don't remove a whole package or folder from m_objects only
 because one of its leaf object's resolveRef() failed.
This is the hotfix.
TODO: Analyze which leaf object's resolveRef() failed, and why.
CCBUG:138344


 M  +3 -1      package.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/package.cpp #610681:610682
@@ -233,7 +233,9 @@
     for (UMLObjectListIt oit(m_objects); oit.current(); ++oit) {
         UMLObject *obj = oit.current();
         if (! obj->resolveRef()) {
-            m_objects.remove(obj);
+            Uml::Object_Type ot = obj->getBaseType();
+            if (ot != Uml::ot_Package && ot != Uml::ot_Folder)
+                m_objects.remove(obj);
             overallSuccess = false;
         }
     }
Comment 3 FiNeX 2009-08-09 15:47:11 UTC
Works for me on current trunk revision :-)