svn commit: r17416 - trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java

Thomas Neustupny <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: thn
Date: 2009-10-20 10:26:29-0700
New Revision: 17416

Modified:
   trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java

Log:
correcting implementation of getRoot

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java?view=diff&pathrev=17416&r1=17415&r2=17416
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java	2009-10-20 10:26:29-0700
@@ -854,8 +854,15 @@
         if (!(handle instanceof Element)) {
             throw new IllegalArgumentException();
         }
-        // TODO: Does this do what we need? - tfm
-        return ((Element) handle).getModel();
+        Object root = ((Element) handle).getModel();
+        if (root == null) {
+            // root is not a model, so we climb up the owners
+            root = handle;
+            while (((Element) root).getOwner() != null) {
+                root = ((Element) root).getOwner();
+            }
+        }
+        return root;
     }
 
     public Object getModelElement(Object handle) {

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2409469

To unsubscribe from this discussion, e-mail: [[email protected]].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.