[Uml-devel] branches/work/soc-umbrello/umbrello/codegenerators

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


SVN commit 866963 by fischer:

Porting r866962.

 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  


--- branches/work/soc-umbrello/umbrello/codegenerators/codedocument.cpp #866962:866963
@@ -191,7 +191,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;
--- branches/work/soc-umbrello/umbrello/codegenerators/codegenerationpolicy.cpp #866962:866963
@@ -568,8 +568,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
--- branches/work/soc-umbrello/umbrello/codegenerators/codegenerator.cpp #866962:866963
@@ -92,7 +92,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;
--- branches/work/soc-umbrello/umbrello/codegenerators/simplecodegenerator.cpp #866962:866963
@@ -59,8 +59,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;
 }
 
--- branches/work/soc-umbrello/umbrello/codegenerators/textblock.cpp #866962:866963
@@ -189,12 +189,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;
 }
 
@@ -291,7 +293,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