Bug 138344 - Umbrello - Saving trashes model, classes lost
Summary: Umbrello - Saving trashes model, classes lost
Status: RESOLVED WORKSFORME
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: RedHat Enterprise Linux Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-04 14:17 UTC by Allan Todd
Modified: 2009-08-09 15:47 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
This is the model which I have the problem with. (100.27 KB, application/octet-stream)
2006-12-04 14:22 UTC, Allan Todd
Details

Note You need to log in before you can comment on or make changes to this bug.
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 :-)