Bug 126480 - Comments are cut short when generating PHP code
Summary: Comments are cut short when generating PHP code
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: 1.5.2
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-29 19:53 UTC by James
Modified: 2006-04-30 17:13 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James 2006-04-29 19:53:05 UTC
Version:           1.5.2 (using KDE 3.5.2, Gentoo)
Compiler:          gcc version 3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)
OS:                Linux (i686) release 2.6.16-gentoo-r1

When generating PHP code (not PHP5) any documentation added for an operation in the Class Diagram is cut short to one line in the generated code.

As an example, I have the following documentation added to an operation in my Class Diagram:

"Performs a text search on the project data. 'project_list' now contains the MySQL results, or the function returns 0 if it fails."

However the generated PHP looks like this:

/**
 * Performs a text search on the project data. 'project_list' now contains the MySQL
 *
 * @return int
 * @access public
 */
Comment 1 Oliver Kellogg 2006-04-30 17:13:54 UTC
SVN commit 535830 by okellogg:

formatDoc(): Append remaining input line to `output' in the loop for splitting
up long lines. Note that this fix applies not only to the PHPWriter but to
all "old" code generators.
BUG:126480


 M  +1 -0      ChangeLog  
 M  +4 -2      umbrello/codegenerator.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #535829:535830
@@ -11,6 +11,7 @@
 * Memory problem when importing classes from c++ sources (122668)
 * Nestable components and subsystems in Component diagram (124326)
 * User interaction with UMLWidget improvements (126391)
+* Comments are cut short when generating PHP code (126480)
 
 Version 1.5.2
 
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/codegenerator.cpp #535829:535830
@@ -684,9 +684,11 @@
         }
         int index;
         do {
-            index = input.findRev(" ", lineWidth + 1);
-            if (index == -1)
+            index = input.findRev(" ", lineWidth);
+            if (index == -1) {
+                output += linePrefix + input + endLine;
                 break;
+            }
             output += linePrefix + input.left(index) + endLine; // add line
             input.remove(0, index + 1); //and remove processed string, including
             // white space