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

Brian Thomas thomas at mail630.gsfc.nasa.gov
Fri Nov 14 13:31:11 UTC 2003


CVS commit by thomas: 

usability bug fix: header code document should come first in codeeditor view


  M +8 -2      cppcodegenerator.cpp   1.14


--- kdesdk/umbrello/umbrello/codegenerators/cppcodegenerator.cpp  #1.13:1.14
@@ -127,5 +127,5 @@ CodeViewerDialog * CPPCodeGenerator::get
         else {
                 // build with passed (source) code document
-                CodeViewerDialog *dialog = new CodeViewerDialog(parent, doc, state);
+                CodeViewerDialog *dialog;
 
                 // use classifier to find appropriate header document
@@ -133,5 +133,11 @@ CodeViewerDialog * CPPCodeGenerator::get
                 CPPHeaderCodeDocument * hdoc = findHeaderCodeDocumentByClassifier(c);
                 if(hdoc)
-                        dialog->addCodeDocument(hdoc);
+                {
+                        // if we have a header document..build with that
+                        dialog = new CodeViewerDialog(parent, hdoc, state);
+                        dialog->addCodeDocument(doc);
+                } else
+                        // shouldnt happen, but lets try to gracefully deliver something.
+                        dialog = new CodeViewerDialog(parent, doc, state);
 
                 // add in makefile if available and desired






More information about the umbrello-devel mailing list