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

gEDA-cvs: CVS update: s_toplevel.c



  User: sdb     
  Date: 07/02/11 16:50:33

  Modified:    .        s_toplevel.c
  Log:
  Fixed bug I caused at code sprint, in which deleted attributes were not
  
  removed from the saved design.
  
  
  
  
  Revision  Changes    Path
  1.24      +39 -19    eda/geda/gaf/gattrib/src/s_toplevel.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: s_toplevel.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/gattrib/src/s_toplevel.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -b -r1.23 -r1.24
  --- s_toplevel.c	10 Feb 2007 18:33:15 -0000	1.23
  +++ s_toplevel.c	11 Feb 2007 21:50:33 -0000	1.24
  @@ -1,4 +1,4 @@
  -/* $Id: s_toplevel.c,v 1.23 2007/02/10 18:33:15 ahvezda Exp $ */
  +/* $Id: s_toplevel.c,v 1.24 2007/02/11 21:50:33 sdb Exp $ */
   
   /* gEDA - GPL Electronic Design Automation
    * gattrib -- gEDA component and net attribute manipulation using spreadsheet.
  @@ -201,7 +201,7 @@
     printf("In s_toplevel_menubar_file_save, about to save out the project\n");
   #endif
   
  -  s_toplevel_gtksheet_to_toplevel();
  +  s_toplevel_gtksheet_to_toplevel();  /* Dumps sheet data into TOPLEVEL */
     s_page_save_all(pr_current);  /* saves all pages in design */
   
     sheet_head->CHANGED = FALSE;
  @@ -724,6 +724,8 @@
     gint visibility = 0;
     gint show_name_value = 0;
   
  +  gint status;
  +
   #if DEBUG
     printf("-----  Entering s_toplevel_update_component_attribs_in_toplevel.\n");
   #endif
  @@ -746,7 +748,18 @@
   	&& a_current->object->text != NULL) {  /* found a name=value attribute pair. */
         /* may need to check more thoroughly here. . . . */
         old_name_value_pair = g_strdup(a_current->object->text->string);
  +
  +      /* Else clause is suggestion from Ales */
  +#if 1
         old_attrib_name = u_basic_breakup_string(old_name_value_pair, '=', 0);
  +      if ( (strcmp(old_attrib_name, "refdes") != 0) &&
  +	   (strcmp(old_attrib_name, "slot") != 0) &&
  +	   (s_attrib_name_in_list(new_comp_attrib_list, old_attrib_name) == FALSE) ) {
  +	s_string_list_add_item(complete_comp_attrib_list, &count, old_name_value_pair);
  +      }
  +#else
  +      status = o_attrib_get_name_value(old_name_value_pair, &old_attrib_name, &old_attrib_value);
  +      if (status == 0) {
         /* Don't put "refdes" or "slot" into list.  Don't put old name=value pair into list if a new
          * one is already in there. */
         if ( (strcmp(old_attrib_name, "refdes") != 0) &&
  @@ -754,6 +767,10 @@
   	   (s_attrib_name_in_list(new_comp_attrib_list, old_attrib_name) == FALSE) ) {
   	s_string_list_add_item(complete_comp_attrib_list, &count, old_name_value_pair);
         }
  +	if (old_attrib_name) g_free (old_attrib_name);
  +	if (old_attrib_value) g_free (old_attrib_value);
  +      }
  + #endif
         g_free(old_name_value_pair);
         g_free(old_attrib_name);
       }
  @@ -785,6 +802,7 @@
      *  and value from o_current  */
     old_attrib_name = u_basic_breakup_string(local_list->data, '=', 0);
     old_attrib_value = o_attrib_search_name_single_count(o_current, old_attrib_name, 0);
  +
   #if DEBUG
     printf("        In s_toplevel_update_component_attribs_in_toplevel, old name = \"%s\" .\n", 
   	 old_attrib_name);
  @@ -792,7 +810,6 @@
   	 old_attrib_value);
   #endif
   
  -
     /*  Next try to get this attrib from new_comp_attrib_list  */
     new_attrib_name = u_basic_breakup_string(local_list->data, '=', 0);      
     if (s_string_list_in_list(new_comp_attrib_list, local_list->data)) {
  @@ -1027,6 +1044,8 @@
     char *new_attrib_value;
     char *old_attrib_value;
   
  +  gint status;
  +
   #if DEBUG
     printf("-----  Entering s_toplevel_update_pin_attribs_in_toplevel.\n");
   #endif
  @@ -1038,9 +1057,10 @@
   #if DEBUG
     printf("        In s_toplevel_update_pin_attribs_in_toplevel, handling entry in master list %s .\n", new_name_value_pair);
   #endif
  +
       new_attrib_name = u_basic_breakup_string(new_name_value_pair, '=', 0);
  -    new_attrib_value = u_basic_breakup_string(new_name_value_pair, '=', 1); /* don't use s_misc_remaining_string
  -									     * since pinattribs are only foo=bar. */
  +  new_attrib_value = u_basic_breakup_string(new_name_value_pair, '=', 1);
  +
       if (strlen(new_attrib_value) == 0) {
         if (new_attrib_value != NULL)
   	g_free(new_attrib_value);   
  
  
  


_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs