The following patch (relative to 0.86) suppresses the `:' separator
in the parameter list of operations if either the parameter name
or the parameter type is a zero length string.

--- /tmp/dia-0.86/objects/UML/uml.c     Sun Apr  9 07:08:23 2000
+++ uml.c       Wed Aug 30 14:01:15 2000
@@ -129,7 +134,10 @@
     param = (UMLParameter  *) list->data;
     list = g_list_next(list);
 
-    len += strlen(param->name) + 1 + strlen(param->type);
+    len += strlen(param->name) + strlen(param->type);
+    if (param->type[0] && param->name[0]) {
+      len += 1;
+    }
     if (param->value != NULL) {
       len += 1 + strlen(param->value);
     }
@@ -158,7 +166,9 @@
     list = g_list_next(list);
 
     strcat(str, param->name);
-    strcat(str, ":");
+    if (param->type[0] && param->name[0]) {
+      strcat(str, ":");
+    }
     strcat(str, param->type);
     
     if (param->value != NULL) {

Similarily, the following small patch supresses the `: ' seperator
between an attribute name and its type if either the attribute name or
the attribute type is a zero length string.

--- /tmp/dia-0.86/objects/UML/uml.c     Sun Apr  9 07:08:23 2000
+++ uml.c       Wed Aug 30 14:11:46 2000
@@ -90,7 +90,10 @@
   int len;
   char *str;
 
-  len = 1 + strlen(attribute->name)  + 2 + strlen(attribute->type);
+  len = 1 + strlen(attribute->name) + strlen(attribute->type);
+  if (attribute->name[0] && attribute->type[0]) {
+    len += 2;
+  }
   if (attribute->value != NULL) {
     len += 3 + strlen(attribute->value);
   }
@@ -101,7 +104,9 @@
   str[1] = 0;
   
   strcat(str, attribute->name);
-  strcat(str, ": ");
+  if (attribute->name[0] && attribute->type[0]) {
+    strcat(str, ": ");
+  }
   strcat(str, attribute->type);
   if (attribute->value != NULL) {
     strcat(str, " = ");

/js

-- 
Juergen Schoenwaelder      Technical University Braunschweig
<[EMAIL PROTECTED]>  Dept. Operating Systems & Computer Networks
Phone: +49 531 391 3289    Bueltenweg 74/75, 38106 Braunschweig, Germany
Fax:   +49 531 391 5936    <URL:http://www.ibr.cs.tu-bs.de/~schoenw/>



Reply via email to