[Uml-devel] [Bug 108688] Generating Javascript Code from a Class diagram hangs Umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Thu Jul 7 20:51:43 UTC 2005


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=108688         
okellogg users sourceforge net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From okellogg users sourceforge net  2005-07-08 05:50 -------
SVN commit 432648 by okellogg:

formatDoc(): Fix glaring bug in the loop for splitting up a single line.
BUG:108688


 M  +5 -3      codegenerator.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerator.cpp #432647:432648
 @ -669,10 +669,10  @
  *  param	linewidth
  */
 QString CodeGenerator::formatDoc(const QString &text, const QString &linePrefix, int lineWidth) {
-    QString output, comment(text);
+    QString output;
 
     const QString endLine = getNewLineEndingChars();
-    QStringList lines = QStringList::split(endLine, comment);
+    QStringList lines = QStringList::split(endLine, text);
     for (QStringList::ConstIterator lit = lines.begin(); lit != lines.end(); ++lit) {
         QString input = *lit;
         input.remove( QRegExp("\\s+$") );
 @ -682,7 +682,9  @
         }
         int index;
         do {
-            index = comment.findRev(" ", lineWidth + 1);
+            index = input.findRev(" ", lineWidth + 1);
+            if (index == -1)
+                break;
             output += linePrefix + input.left(index) + endLine; // add line
             input.remove(0, index + 1);	//and remove processed string, including
             // white space




More information about the umbrello-devel mailing list