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

Oliver Kellogg okellogg at users.sourceforge.net
Thu Jul 7 20:53:39 UTC 2005


SVN commit 432649 by okellogg:

Backport fix for bug 108688 from main trunk.

 M  +5 -3      codegenerator.cpp  


--- branches/KDE/3.4/kdesdk/umbrello/umbrello/codegenerator.cpp #432648:432649
@@ -666,10 +666,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+$") );
@@ -679,7 +679,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