[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Wed Dec 8 23:30:01 UTC 2004


CVS commit by okellogg: 

Use reentrant iterators.
BUG:93219


  M +7 -4      umldoc.cpp   1.210


--- kdesdk/umbrello/umbrello/umldoc.cpp  #1.209:1.210
@@ -1341,10 +1341,12 @@ void UMLDoc::addAssociation(UMLAssociati
         // information was taken from the <UML:AssocWidget> tag.
         UMLAssociationList assocs = getAssociations();
-        UMLAssociation *a;
-        for (a = assocs.first(); a; a = assocs.next()) {
+        for (UMLAssociationListIt ait(assocs); ait.current(); ++ait) {
+                UMLAssociation *a = ait.current();
                 // check if its already been added (shouldnt be the case right now
-                // as UMLAssociations only belong to one associationwidget at a time right now)
+                // as UMLAssociations only belong to one associationwidget at a time)
                 if (a == Assoc)
                 {
+                        kdDebug() << "UMLDoc::addAssociation: duplicate addition attempted"
+                                  << endl;
                         return;
                 }
@@ -1371,5 +1373,6 @@ void UMLDoc::addAssocToConcepts(UMLAssoc
         Uml::IDType BId = a->getObjectId(Uml::B);
         UMLClassifierList concepts = getConcepts();
-        for (UMLClassifier *c = concepts.first(); c; c = concepts.next()) {
+        for (UMLClassifierListIt it(concepts); it.current(); ++it) {
+                UMLClassifier *c = it.current();
                 switch (a->getAssocType()) {
                         // for the next cases should add association to all classes involved






More information about the umbrello-devel mailing list