[Uml-devel] branches/KDE/3.5/kdesdk/umbrello/umbrello/codegenerators

Oliver Kellogg okellogg at users.sourceforge.net
Mon Oct 3 11:25:26 UTC 2005


SVN commit 466940 by okellogg:

Update copyright info.
computeAssocTypeAndRole(): Replace C-style pointer cast by dynamic_cast.
writeClass(): Treat Implementation visibility same as private vis.


 M  +15 -14    adawriter.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/codegenerators/adawriter.cpp #466939:466940
@@ -1,13 +1,10 @@
 /***************************************************************************
-                          adawriter.cpp  -  description
-                             -------------------
-    Based on javawriter.cpp by Luis De la Parra Blum
-    begin                : Sat Dec 14 2002
-    copyright            : (C) 2002 by Oliver Kellogg
-    email                : okellogg at users.sourceforge.net
- ***************************************************************************/
-
-/***************************************************************************
+ *                        adawriter.cpp  -  description                    *
+ *                           -------------------                           *
+ *  Based on javawriter.cpp by Luis De la Parra Blum                       *
+ *  copyright            : (C) 2002 by Oliver Kellogg                      *
+ *    (C) 2003-2005 Umbrello UML Modeller Authors <uml-devel@ uml.sf.net>  *
+ ***************************************************************************
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
@@ -116,10 +113,6 @@
 
 void AdaWriter::computeAssocTypeAndRole
 (UMLAssociation *a, QString& typeName, QString& roleName) {
-    UMLClassifier* c = (UMLClassifier*)a->getObject(Uml::A);
-    typeName = cleanName(c->getName());
-    if (! a->getMulti(Uml::A).isEmpty())
-        typeName.append("_Array_Access");
     roleName = a->getRoleName(Uml::A);
     if (roleName.isEmpty()) {
         if (a->getMulti(Uml::A).isEmpty()) {
@@ -130,6 +123,12 @@
             roleName.append("_Vector");
         }
     }
+    UMLClassifier* c = dynamic_cast<UMLClassifier*>(a->getObject(Uml::A));
+    if (c == NULL)
+        return;
+    typeName = cleanName(c->getName());
+    if (! a->getMulti(Uml::A).isEmpty())
+        typeName.append("_Array_Access");
 }
 
 void AdaWriter::writeClass(UMLClassifier *c) {
@@ -460,7 +459,9 @@
     UMLOperationList oppriv;
     oppriv.setAutoDelete(false);
     for (op = opl.first(); op; op = opl.next()) {
-          if (op->getVisibility() == Uml::Visibility::Private)
+          const Uml::Visibility::Value vis = op->getVisibility();
+          if (vis == Uml::Visibility::Private ||
+              vis == Uml::Visibility::Implementation)
             oppriv.append(op);
     }
     if (forceSections() || oppriv.count())




More information about the umbrello-devel mailing list