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

Oliver Kellogg okellogg at users.sourceforge.net
Sat Apr 21 18:20:15 UTC 2007


SVN commit 656563 by okellogg:

addAssociation(): Remove prefix m_ at non member variables.

 M  +8 -8      umlview.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umlview.cpp #656562:656563
@@ -1617,11 +1617,12 @@
 }
 
 // Add the association, and its child widgets to this view
-bool UMLView::addAssociation( AssociationWidget* pAssoc , bool isPasteOperation) {
+bool UMLView::addAssociation(AssociationWidget* pAssoc , bool isPasteOperation) {
 
     if (!pAssoc) {
         return false;
     }
+    const Association_Type type = pAssoc->getAssocType();
 
     if( isPasteOperation )
     {
@@ -1631,7 +1632,6 @@
             return false;
 
         Uml::IDType ida = Uml::id_None, idb = Uml::id_None;
-        Association_Type type = pAssoc -> getAssocType();
         if( getType() == dt_Collaboration || getType() == dt_Sequence ) {
             //check local log first
             ida = m_pIDChangesLog->findNewID( pAssoc->getWidgetID(A) );
@@ -1668,18 +1668,18 @@
         pAssoc->setWidget(findWidget(idb), B);
     }
 
-    UMLWidget * m_pWidgetA = findWidget(pAssoc->getWidgetID(A));
-    UMLWidget * m_pWidgetB = findWidget(pAssoc->getWidgetID(B));
+    UMLWidget * pWidgetA = findWidget(pAssoc->getWidgetID(A));
+    UMLWidget * pWidgetB = findWidget(pAssoc->getWidgetID(B));
     //make sure valid widget ids
-    if (!m_pWidgetA || !m_pWidgetB) {
+    if (!pWidgetA || !pWidgetB) {
         return false;
     }
 
     //make sure valid
-    if( !isPasteOperation &&
-            !AssocRules::allowAssociation(pAssoc->getAssocType(), m_pWidgetA, m_pWidgetB, false) ) {
+    if (!isPasteOperation && !m_pDoc->loading() &&
+        !AssocRules::allowAssociation(type, pWidgetA, pWidgetB, false)) {
         kWarning() << "UMLView::addAssociation: allowAssociation returns false "
-                    << "for AssocType " << pAssoc->getAssocType() << endl;
+                   << "for AssocType " << type << endl;
         return false;
     }
 




More information about the umbrello-devel mailing list