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

Andi Fischer andi.fischer at hispeed.ch
Thu Oct 2 13:56:00 UTC 2008


SVN commit 866962 by fischer:

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

 M  +1 -1      codedocument.cpp  
 M  +2 -1      codegenerationpolicy.cpp  
 M  +1 -1      codegenerator.cpp  
 M  +2 -1      simplecodegenerator.cpp  
 M  +5 -3      textblock.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/codedocument.cpp #866961:866962
@@ -129,7 +129,7 @@
 
     tag = tag + "_0";
     int number = m_lastTagIndex;
-    for ( ; findTextBlockByTag(tag, true); number++) {
+    for ( ; findTextBlockByTag(tag, true); ++number) {
         tag = prefix + '_' + QString::number(number);
     }
     m_lastTagIndex = number;
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/codegenerationpolicy.cpp #866961:866962
@@ -515,8 +515,9 @@
     QTextStream ts(&f);
     QString retstr;
     QString endLine = getNewLineEndingChars();
-    for(int l = 0; l < MAXLINES && !ts.atEnd(); l++)
+    for (int l = 0; l < MAXLINES && !ts.atEnd(); ++l) {
         retstr += ts.readLine()+endLine;
+    }
 
     //do variable substitution
     retstr.replace( QRegExp("%author%"),QString(qgetenv("USER")));  //get the user name from some where else
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/codegenerator.cpp #866961:866962
@@ -88,7 +88,7 @@
         QString prefix = "doc";
         QString id = prefix + "_0";
         int number = lastIDIndex;
-        for ( ; findCodeDocumentByID(id); number++) {
+        for ( ; findCodeDocumentByID(id); ++number) {
             id = prefix + '_' + QString::number(number);
         }
         lastIDIndex = number;
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/simplecodegenerator.cpp #866961:866962
@@ -56,8 +56,9 @@
 QString SimpleCodeGenerator::getIndent ()
 {
     QString myIndent;
-    for (int i = 0 ; i < m_indentLevel ; i++)
+    for (int i = 0 ; i < m_indentLevel; ++i) {
         myIndent.append(m_indentation);
+    }
     return myIndent;
 }
 
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/textblock.cpp #866961:866962
@@ -111,12 +111,14 @@
 
 QString TextBlock::getIndentationString ( int level ) const
 {
-    if (!level)
+    if (!level) {
         level = m_indentationLevel;
+    }
     QString indentAmount = getIndentation();
     QString indentation;
-    for(int i=0; i<level; i++)
+    for (int i=0; i<level; ++i) {
         indentation.append(indentAmount);
+    }
     return indentation;
 }
 
@@ -167,7 +169,7 @@
         if (!text.contains(QRegExp(breakStr + "\\$")))
             matches++;
 
-        for (int i=0; i < matches; i++)
+        for (int i=0; i < matches; ++i)
         {
             QString line = text.section(QRegExp(breakStr),i,i);
             output += linePrefix + line;




More information about the umbrello-devel mailing list