[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: CVS update: g_hook.nw



  User: cnieves 
  Date: 06/05/20 16:54:50

  Modified:    .        g_hook.nw
  Log:
  Fixed bug when calculating the object bounds in text autoplacing.
  
  
  
  
  Revision  Changes    Path
  1.10      +10 -33    eda/geda/devel/gschem/noweb/g_hook.nw
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: g_hook.nw
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/gschem/noweb/g_hook.nw,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -b -r1.9 -r1.10
  --- g_hook.nw	17 May 2006 14:20:48 -0000	1.9
  +++ g_hook.nw	20 May 2006 20:54:49 -0000	1.10
  @@ -426,8 +426,6 @@
     SCM vertical = SCM_EOL;
     SCM horizontal = SCM_EOL;
     OBJECT *new_object = NULL;
  -  OBJECT *new_node = NULL;
  -  OBJECT *aux, *last_added=NULL;
     gboolean include_attribs;
   
     SCM_ASSERT (scm_boolean_p(scm_inc_attribs), scm_inc_attribs,
  @@ -439,27 +437,11 @@
   	      object_smob, SCM_ARG1, "get-object-bounds");
   
     if (!include_attribs) {
  -    /* Don't include the attributes when computing the bounds.
  -       So make a new object list without the attributes (those which
  -       have the attached_to != NULL) */
  -    aux = object;
  -    while (aux != NULL) {
  -      if (aux->attached_to == NULL) {
  -	new_node = (OBJECT *) malloc(sizeof(OBJECT));
  -	memcpy (new_node, aux, sizeof(OBJECT));
  -	new_node->next = NULL;
  -	new_node->prev = last_added;
  -	if (new_object) {
  -	  last_added->next = new_node;
  -	  last_added = new_node;
  -	}
  -	else {
  -	  new_object = new_node;
  -	  last_added = new_object;
  -	}
  -      }
  -      aux = aux->next;
  -    }
  +    new_object = (OBJECT *) malloc(sizeof(OBJECT));
  +    memcpy (new_object, object, sizeof(OBJECT));
  +    new_object->attribs = NULL;
  +    new_object->next = NULL;
  +    new_object->prev = NULL;
     }
     else {
       new_object = object;
  @@ -469,13 +451,8 @@
   			    &left, &top, &right, &bottom);
     
     if (!include_attribs) {
  -    /* Free the newly created list */
  -    aux = new_object;
  -    while (aux != NULL) {
  -      new_object = aux->next;
  -      g_free(aux);
  -      aux = new_object;
  -    }
  +    /* Free the newly created object */
  +    g_free(new_object);
     }
     
     horizontal = scm_cons (SCM_MAKINUM(left), SCM_MAKINUM(right));