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

Andi Fischer andi.fischer at hispeed.ch
Fri Oct 3 07:34:41 UTC 2008


SVN commit 867238 by fischer:

Krazy: fixing postfix usage of ++ and --.

 M  +25 -16    assocrules.cpp  
 M  +2 -3      model_utils.cpp  
 M  +1 -1      uml.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/assocrules.cpp #867237:867238
@@ -1,11 +1,10 @@
 /***************************************************************************
- *                                                                         *
  *   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  *
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2002-2007                                               *
+ *   copyright (C) 2002-2008                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -32,9 +31,13 @@
 
 using namespace Uml;
 
-AssocRules::AssocRules() {}
+AssocRules::AssocRules()
+{
+}
 
-AssocRules::~AssocRules() {}
+AssocRules::~AssocRules()
+{
+}
 
 bool allowAssociation( Association_Type/* assocType*/, const std::type_info/* &type*/ )
 {
@@ -42,10 +45,11 @@
 
 }
 
-bool AssocRules::allowAssociation( Uml::Association_Type assocType, UMLWidget * widget ) {
+bool AssocRules::allowAssociation( Uml::Association_Type assocType, UMLWidget * widget )
+{
     Widget_Type widgetType = widget -> getBaseType();
     bool bValid = false;
-    for (int i = 0; i < m_nNumRules; i++) {
+    for (int i = 0; i < m_nNumRules; ++i) {
         if (assocType == m_AssocRules[i].assoc_type) {
             if (widgetType == m_AssocRules[i].widgetA_type
                     || widgetType == m_AssocRules[i].widgetB_type ) {
@@ -129,7 +133,8 @@
 // use this method.
 bool AssocRules::allowAssociation( Uml::Association_Type assocType,
                                    UMLWidget * widgetA, UMLWidget * widgetB,
-                                   bool extendedCheck ) {
+                                   bool extendedCheck )
+{
     Widget_Type widgetTypeA = widgetA->getBaseType();
     Widget_Type widgetTypeB = widgetB->getBaseType();
     bool bValid = false;
@@ -138,7 +143,7 @@
         return allowSelf( assocType, widgetTypeA );
     }
 
-    for (int i = 0; i < m_nNumRules; i++) {
+    for (int i = 0; i < m_nNumRules; ++i) {
         if (assocType == m_AssocRules[i].assoc_type) {
             if( (widgetTypeA == m_AssocRules[i].widgetA_type &&
                     widgetTypeB == m_AssocRules[i].widgetB_type) ||
@@ -284,23 +289,26 @@
     return false;
 }
 
-bool AssocRules::allowRole( Uml::Association_Type assocType ) {
-    for( int i = 0; i < m_nNumRules; i++ )
+bool AssocRules::allowRole( Uml::Association_Type assocType )
+{
+    for( int i = 0; i < m_nNumRules; ++i )
         if( assocType == m_AssocRules[ i ].assoc_type )
             return m_AssocRules[ i ].role;
     return false;
 }
 
-bool AssocRules::allowMultiplicity( Uml::Association_Type assocType, Uml::Widget_Type widgetType ) {
-    for( int i = 0; i < m_nNumRules; i++ )
+bool AssocRules::allowMultiplicity( Uml::Association_Type assocType, Uml::Widget_Type widgetType )
+{
+    for( int i = 0; i < m_nNumRules; ++i )
         if( assocType == m_AssocRules[ i ].assoc_type )
             if( widgetType == m_AssocRules[ i ].widgetA_type || widgetType == m_AssocRules[ i ].widgetB_type )
                 return m_AssocRules[ i ].multiplicity;
     return false;
 }
 
-bool AssocRules::allowSelf( Uml::Association_Type assocType, Uml::Widget_Type widgetType ) {
-    for( int i = 0; i < m_nNumRules; i++ )
+bool AssocRules::allowSelf( Uml::Association_Type assocType, Uml::Widget_Type widgetType )
+{
+    for( int i = 0; i < m_nNumRules; ++i )
         if( assocType == m_AssocRules[ i ].assoc_type )
             if( widgetType == m_AssocRules[ i ].widgetA_type || widgetType == m_AssocRules[ i ].widgetB_type )
                 return m_AssocRules[ i ].self;
@@ -308,10 +316,11 @@
     return false;
 }
 
-Uml::Association_Type AssocRules::isGeneralisationOrRealisation(UMLWidget* widgetA, UMLWidget* widgetB) {
+Uml::Association_Type AssocRules::isGeneralisationOrRealisation(UMLWidget* widgetA, UMLWidget* widgetB)
+{
     Widget_Type widgetTypeA = widgetA->getBaseType();
     Widget_Type widgetTypeB = widgetB->getBaseType();
-    for (int i = 0; i < m_nNumRules; i++) {
+    for (int i = 0; i < m_nNumRules; ++i) {
         if (m_AssocRules[i].assoc_type == at_Realization &&
                 widgetTypeA == m_AssocRules[i].widgetA_type &&
                 widgetTypeB == m_AssocRules[i].widgetB_type) {
--- trunk/KDE/kdesdk/umbrello/umbrello/model_utils.cpp #867237:867238
@@ -1,5 +1,4 @@
 /***************************************************************************
- *                                                                         *
  *   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  *
  *   the Free Software Foundation; either version 2 of the License, or     *
@@ -278,7 +277,7 @@
     }
     UMLDoc *doc = UMLApp::app()->getDocument();
     QString name = currentName;
-    for (int number = 1; !doc->isUnique(name, parentPkg); number++)  {
+    for (int number = 1; !doc->isUnique(name, parentPkg); ++number)  {
         name = currentName + '_' + QString::number(number);
     }
     return name;
@@ -380,7 +379,7 @@
             {
                 UMLAssociation *assoc = static_cast<UMLAssociation*>(o);
                 UMLDoc *umldoc = UMLApp::app()->getDocument();
-                for (int r = Uml::A; r <= Uml::B; r++) {
+                for (int r = Uml::A; r <= Uml::B; ++r) {
                     UMLObject *roleObj = assoc->getObject((Uml::Role_Type)r);
                     if (roleObj == NULL) {
                         // Ouch! we have been called while types are not yet resolved
--- trunk/KDE/kdesdk/umbrello/umbrello/uml.cpp #867237:867238
@@ -1955,7 +1955,7 @@
 void UMLApp::updateLangSelectMenu(Uml::Programming_Language activeLanguage)
 {
     //m_langSelect->clear();
-    for (int i = 0; i < Uml::pl_Reserved; i++) {
+    for (int i = 0; i < Uml::pl_Reserved; ++i) {
         m_langAct[i]->setChecked(i == activeLanguage);
     }
 }




More information about the umbrello-devel mailing list