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

gEDA-cvs: gaf.git: branch: master updated (1.5.0-20080706-169-g0090ef6)



The branch, master has been updated
       via  0090ef6ff6e9adfc8ab48d7d7aa110dbab1bed79 (commit)
       via  68e398b00526dacc4ce1d610af192d4a2977db4d (commit)
       via  1745bca0359488bb6f8bd06d84f7ae952e48d665 (commit)
       via  7baf5c629eb620e7db9b3fa5837cc07bdfe29f4f (commit)
      from  6b78047686ad919b90b8119250acde3f50bd3dc8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 gattrib/src/s_object.c        |    4 +-
 gschem/src/i_callbacks.c      |    5 +---
 gschem/src/o_attrib.c         |    4 +--
 gschem/src/o_complex.c        |    9 -------
 gschem/src/o_slot.c           |    5 +---
 libgeda/include/prototype.h   |    3 +-
 libgeda/include/struct.h      |    1 -
 libgeda/src/a_basic.c         |    4 ---
 libgeda/src/o_attrib.c        |   51 +++++++++++++++++++---------------------
 libgeda/src/o_complex_basic.c |   27 +++++----------------
 libgeda/src/o_list.c          |   32 ++++++-------------------
 libgeda/src/o_text_basic.c    |    9 +------
 libgeda/src/s_page.c          |    5 ----
 13 files changed, 47 insertions(+), 112 deletions(-)


=================
 Commit Messages
=================

commit 0090ef6ff6e9adfc8ab48d7d7aa110dbab1bed79
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Sep 17 19:25:00 2008 +0100

    libgeda: Add convenience function o_attrib_attach_list()
    
    Calls o_attrib_attach() for each item in the passed GList

:100644 100644 3f279a3... ccddae5... M	libgeda/include/prototype.h
:100644 100644 3d5af50... cda88f5... M	libgeda/src/o_attrib.c

commit 68e398b00526dacc4ce1d610af192d4a2977db4d
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Sep 17 19:24:59 2008 +0100

    libgeda: Tidy / simplify o_glist_copy_all_to_glist()
    
    Since we no longer have to pass o_attrib_attach() a linked object list
    for it to find the attrib to attach, we don't have to link the objects
    up as we copy them, and can call o_glist_relink_objects() at the end.

:100644 100644 b07d414... 74e60dd... M	libgeda/src/o_list.c

commit 1745bca0359488bb6f8bd06d84f7ae952e48d665
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Sep 17 19:24:59 2008 +0100

    Remove unused TOPLEVEL variable object_parent

:100644 100644 ea942c4... 8779d73... M	gschem/src/o_complex.c
:100644 100644 c12839b... 4224034... M	libgeda/include/struct.h
:100644 100644 a923098... 4d10ef8... M	libgeda/src/a_basic.c
:100644 100644 c02ee0a... fd10ee7... M	libgeda/src/o_complex_basic.c
:100644 100644 b75c24e... 9d76eb7... M	libgeda/src/o_text_basic.c
:100644 100644 f151b51... 0d8e664... M	libgeda/src/s_page.c

commit 7baf5c629eb620e7db9b3fa5837cc07bdfe29f4f
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Thu Sep 11 21:36:35 2008 +0100

    libgeda: Tidy o_attrib_attach() harder
    
    Remove searching in parent_list for the attribute we're about to attach.
    This check isn't needed, we were passed the attribute as an argument.
    Let the caller be responsible for making sure it is linked into the
    appropriate object list.

:100644 100644 4a28465... d48ebf4... M	gattrib/src/s_object.c
:100644 100644 f5f5f22... bcc1935... M	gschem/src/i_callbacks.c
:100644 100644 51386f9... 1fc814e... M	gschem/src/o_attrib.c
:100644 100644 4b12984... 3546e11... M	gschem/src/o_slot.c
:100644 100644 14c037f... 3f279a3... M	libgeda/include/prototype.h
:100644 100644 9fdb669... 3d5af50... M	libgeda/src/o_attrib.c
:100644 100644 fb62c76... c02ee0a... M	libgeda/src/o_complex_basic.c
:100644 100644 e1b72e3... b07d414... M	libgeda/src/o_list.c

=========
 Changes
=========

commit 0090ef6ff6e9adfc8ab48d7d7aa110dbab1bed79
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Sep 17 19:25:00 2008 +0100

    libgeda: Add convenience function o_attrib_attach_list()
    
    Calls o_attrib_attach() for each item in the passed GList

diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index 3f279a3..ccddae5 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -101,6 +101,7 @@ OBJECT *o_attrib_search(GList *list, OBJECT *item);
 void o_attrib_add(TOPLEVEL *toplevel, OBJECT *object, OBJECT *item);
 void o_attrib_free(TOPLEVEL *toplevel, OBJECT *current);
 void o_attrib_attach(TOPLEVEL *toplevel, OBJECT *attrib, OBJECT *object);
+void o_attrib_attach_list(TOPLEVEL *toplevel, GList *attr_list, OBJECT *object);
 void o_attrib_free_all(TOPLEVEL *toplevel, GList *list);
 void o_attrib_print(GList *attributes);
 void o_attrib_remove(GList **list, OBJECT *remove);
diff --git a/libgeda/src/o_attrib.c b/libgeda/src/o_attrib.c
index 3d5af50..cda88f5 100644
--- a/libgeda/src/o_attrib.c
+++ b/libgeda/src/o_attrib.c
@@ -196,6 +196,24 @@ void o_attrib_attach (TOPLEVEL *toplevel, OBJECT *attrib, OBJECT *object)
 }
 
 
+/*! \brief Attach list of existing attributes to an object.
+ *  \par Function Description
+ *  Attach list of existing attributes to an object.
+ *
+ *  \param [in]  toplevel   The TOPLEVEL object.
+ *  \param [in]  attr_list  The list of attributes to be added.
+ *  \param [out] object     The object where you want to add item as an attribute.
+ */
+void o_attrib_attach_list (TOPLEVEL *toplevel,
+                           GList *attr_list, OBJECT *object)
+{
+  GList *iter;
+
+  for (iter = attr_list; iter != NULL; iter = g_list_next (iter))
+    o_attrib_attach (toplevel, iter->data, object);
+}
+
+
 /*! \brief Free all attribute items in a list.
  *  \par Function Description
  *  Free all attribute items in a list.

commit 68e398b00526dacc4ce1d610af192d4a2977db4d
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Sep 17 19:24:59 2008 +0100

    libgeda: Tidy / simplify o_glist_copy_all_to_glist()
    
    Since we no longer have to pass o_attrib_attach() a linked object list
    for it to find the attrib to attach, we don't have to link the objects
    up as we copy them, and can call o_glist_relink_objects() at the end.

diff --git a/libgeda/src/o_list.c b/libgeda/src/o_list.c
index b07d414..74e60dd 100644
--- a/libgeda/src/o_list.c
+++ b/libgeda/src/o_list.c
@@ -262,14 +262,6 @@ GList *o_glist_copy_all_to_glist(TOPLEVEL *toplevel,
     if (src_object->type != OBJ_TEXT && src_object->type != OBJ_HEAD) {
       dst_object = o_list_copy_to (toplevel, NULL, src_object, flag, NULL);
       dst_object->sid = global_sid++;
-      /* Link the OBJECT nodes in the GList to allow attrib attaching */
-      if (dest != NULL) {
-        dst_object->prev = (OBJECT *)dest->data;
-        dst_object->prev->next = dst_object;
-      } else {
-        dst_object->prev = NULL;
-      }
-      dst_object->next = NULL;
       dest = g_list_prepend (dest, dst_object);
     }
 
@@ -294,21 +286,12 @@ GList *o_glist_copy_all_to_glist(TOPLEVEL *toplevel,
     if (src_object->type == OBJ_TEXT) {
       dst_object = o_list_copy_to (toplevel, NULL, src_object, flag, NULL);
       dst_object->sid = global_sid++;
-      /* Link the OBJECT nodes in the GList to allow attrib attaching */
-      if (dest != NULL) {
-        dst_object->prev = (OBJECT *)dest->data;
-        dst_object->prev->next = dst_object;
-      } else {
-        dst_object->prev = NULL;
-      }
-      dst_object->next = NULL;
       dest = g_list_prepend (dest, dst_object);
 
-      if (src_object->attached_to /*&& !toplevel->ADDING_SEL*/) {
-        if (src_object->attached_to->copied_to) {
-          o_attrib_attach(toplevel, dst_object,
-                          src_object->attached_to->copied_to);
-        }
+      if (src_object->attached_to != NULL &&
+          src_object->attached_to->copied_to != NULL) {
+        o_attrib_attach(toplevel, dst_object,
+                        src_object->attached_to->copied_to);
       }
     }
 
@@ -330,6 +313,9 @@ GList *o_glist_copy_all_to_glist(TOPLEVEL *toplevel,
   /* Reverse the list to be in the correct order */
   dest = g_list_reverse (dest);
 
+  /* Link the copied objects together for good measure */
+  o_glist_relink_objects (dest);
+
   toplevel->ADDING_SEL = adding_sel_save;
 
   return(dest);

commit 1745bca0359488bb6f8bd06d84f7ae952e48d665
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Sep 17 19:24:59 2008 +0100

    Remove unused TOPLEVEL variable object_parent

diff --git a/gschem/src/o_complex.c b/gschem/src/o_complex.c
index ea942c4..8779d73 100644
--- a/gschem/src/o_complex.c
+++ b/gschem/src/o_complex.c
@@ -70,7 +70,6 @@ void o_complex_draw_xor(GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *obje
 void o_complex_prepare_place(GSCHEM_TOPLEVEL *w_current, const char *sym_name)
 {
   TOPLEVEL *toplevel = w_current->toplevel;
-  OBJECT *temp_parent;
   OBJECT *temp_list;
   OBJECT *o_current;
   OBJECT *o_start;
@@ -92,11 +91,6 @@ void o_complex_prepare_place(GSCHEM_TOPLEVEL *w_current, const char *sym_name)
 
     o_start = temp_list = add_head();
 
-    /* Reset the object_parent pointer so attribute
-     * attachment works in this temporary list. */
-    temp_parent = toplevel->page_current->object_parent;
-    toplevel->page_current->object_parent = temp_list;
-
     toplevel->ADDING_SEL=1;
     buffer = s_clib_symbol_get_data_by_name (sym_name);
     temp_list = o_read_buffer (toplevel,
@@ -106,9 +100,6 @@ void o_complex_prepare_place(GSCHEM_TOPLEVEL *w_current, const char *sym_name)
     g_free (buffer);
     toplevel->ADDING_SEL=0;
 
-    /* Put object_parent back where it should be */
-    toplevel->page_current->object_parent = temp_parent;
-
     /* Take the added objects, severing them from the HEAD node */
     o_current = o_start->next;
     o_current->prev = NULL;
diff --git a/libgeda/include/struct.h b/libgeda/include/struct.h
index c12839b..4224034 100644
--- a/libgeda/include/struct.h
+++ b/libgeda/include/struct.h
@@ -339,7 +339,6 @@ struct st_page {
 
   OBJECT *object_head;
   OBJECT *object_tail;
-  OBJECT *object_parent;
   SELECTION *selection_list; /* new selection mechanism */
   GList *place_list;
   OBJECT *object_lastplace;
diff --git a/libgeda/src/a_basic.c b/libgeda/src/a_basic.c
index a923098..4d10ef8 100644
--- a/libgeda/src/a_basic.c
+++ b/libgeda/src/a_basic.c
@@ -254,7 +254,6 @@ OBJECT *o_read_buffer(TOPLEVEL *toplevel, OBJECT *object_list,
   char objtype;
   OBJECT *object_list_save=NULL;
   OBJECT *temp_tail=NULL;
-  OBJECT *temp_parent=NULL;
   OBJECT *object_before_attr=NULL;
   unsigned int release_ver;
   unsigned int fileformat_ver;
@@ -400,8 +399,6 @@ OBJECT *o_read_buffer(TOPLEVEL *toplevel, OBJECT *object_list,
         	object_list = object_list_save->complex->prim_objs;
 				
         	temp_tail = toplevel->page_current->object_tail;
-        	temp_parent = toplevel->page_current->object_parent;
-        	toplevel->page_current->object_parent = object_list;
 
 		embedded_level++;
 	} else {
@@ -420,7 +417,6 @@ OBJECT *o_read_buffer(TOPLEVEL *toplevel, OBJECT *object_list,
                  *                   object_list->y, object_list->complex);
 		 */
 	        toplevel->page_current->object_tail = temp_tail;
-	        toplevel->page_current->object_parent = temp_parent;
 
           o_complex_recalc( toplevel, object_list );
 		embedded_level--;
diff --git a/libgeda/src/o_complex_basic.c b/libgeda/src/o_complex_basic.c
index c02ee0a..fd10ee7 100644
--- a/libgeda/src/o_complex_basic.c
+++ b/libgeda/src/o_complex_basic.c
@@ -306,7 +306,6 @@ OBJECT *o_complex_add(TOPLEVEL *toplevel, OBJECT *object_list,
 {
   OBJECT *new_node=NULL;
   OBJECT *prim_objs=NULL;
-  OBJECT *temp_parent=NULL;
   int save_adding_sel = 0;
   int loaded_normally = FALSE;
   gboolean use_object_list;
@@ -444,13 +443,9 @@ OBJECT *o_complex_add(TOPLEVEL *toplevel, OBJECT *object_list,
     /* filename was found */
     loaded_normally = TRUE;
 
-    temp_parent = toplevel->page_current->object_parent;
-    toplevel->page_current->object_parent = prim_objs;
-
     /* add connections till translated */
     o_read_buffer(toplevel, prim_objs, buffer, -1, new_node->complex_basename);
 
-    toplevel->page_current->object_parent = temp_parent;
     g_free (buffer);
     
   }
diff --git a/libgeda/src/o_text_basic.c b/libgeda/src/o_text_basic.c
index b75c24e..9d76eb7 100644
--- a/libgeda/src/o_text_basic.c
+++ b/libgeda/src/o_text_basic.c
@@ -184,7 +184,7 @@ void o_text_print_set(void)
 OBJECT *o_text_load_font(TOPLEVEL *toplevel, gunichar needed_char)
 {
   gchar *temp_string = NULL;
-  OBJECT *temp_parent, *o_font_set;
+  OBJECT *o_font_set;
   int not_found = FALSE;
   gchar *aux_str2;
   GError *err = NULL;
@@ -260,11 +260,6 @@ OBJECT *o_text_load_font(TOPLEVEL *toplevel, gunichar needed_char)
 
     o_font_set->font_text_size = aux_obj->font_text_size;
   }
-	
-
-  temp_parent = toplevel->page_current->object_parent;
-  /* set the addition of attributes to the head node */
-  toplevel->page_current->object_parent = o_font_set->font_prim_objs;
 
   o_font_set->font_prim_objs = o_read(toplevel, o_font_set->font_prim_objs,
 				      temp_string, &err);
@@ -275,8 +270,6 @@ OBJECT *o_text_load_font(TOPLEVEL *toplevel, gunichar needed_char)
     g_error_free (err);
   }
 
-  toplevel->page_current->object_parent = temp_parent;
-
   o_font_set->font_prim_objs = return_head(o_font_set->font_prim_objs);
 
   g_free(temp_string);
diff --git a/libgeda/src/s_page.c b/libgeda/src/s_page.c
index f151b51..0d8e664 100644
--- a/libgeda/src/s_page.c
+++ b/libgeda/src/s_page.c
@@ -95,11 +95,6 @@ PAGE *s_page_new (TOPLEVEL *toplevel, const gchar *filename)
   /* do this just to be sure that object tail is truely correct */
   page->object_tail = return_tail(page->object_head);
 
-  /* setup parent to point to list */
-  /* this is used for attributes so */
-  /* that we know which list to search */
-  page->object_parent = page->object_head; 
-
   /* init undo struct pointers */
   s_undo_init(page);
   

commit 7baf5c629eb620e7db9b3fa5837cc07bdfe29f4f
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Thu Sep 11 21:36:35 2008 +0100

    libgeda: Tidy o_attrib_attach() harder
    
    Remove searching in parent_list for the attribute we're about to attach.
    This check isn't needed, we were passed the attribute as an argument.
    Let the caller be responsible for making sure it is linked into the
    appropriate object list.

diff --git a/gattrib/src/s_object.c b/gattrib/src/s_object.c
index 4a28465..d48ebf4 100644
--- a/gattrib/src/s_object.c
+++ b/gattrib/src/s_object.c
@@ -326,8 +326,8 @@ OBJECT *s_object_attrib_add_attrib_in_object(TOPLEVEL * pr_current, char *text_s
   /* now attach the attribute to the object (if o_current is not NULL) */
   /* remember that o_current contains the object to get the attribute */
   if (o_current) {
-    o_attrib_attach(pr_current, pr_current->page_current->object_head,
-		    pr_current->page_current->object_tail, o_current);
+    o_attrib_attach (pr_current, pr_current->page_current->object_tail,
+                     o_current);
   }
 
   o_selection_add( pr_current->page_current->selection_list,
diff --git a/gschem/src/i_callbacks.c b/gschem/src/i_callbacks.c
index f5f5f22..bcc1935 100644
--- a/gschem/src/i_callbacks.c
+++ b/gschem/src/i_callbacks.c
@@ -3051,10 +3051,7 @@ DEFINE_I_CALLBACK(attributes_attach)
   s_current = g_list_next(s_current);
   while (s_current != NULL) {
     if (s_current->data) {
-      o_attrib_attach(w_current->toplevel,
-                      w_current->toplevel->page_current->object_head,
-                      (OBJECT *)s_current->data,
-                      first_object);
+      o_attrib_attach(w_current->toplevel, s_current->data, first_object);
       w_current->toplevel->page_current->CHANGED=1;
     }
     s_current = g_list_next(s_current);
diff --git a/gschem/src/o_attrib.c b/gschem/src/o_attrib.c
index 51386f9..1fc814e 100644
--- a/gschem/src/o_attrib.c
+++ b/gschem/src/o_attrib.c
@@ -252,9 +252,7 @@ OBJECT *o_attrib_add_attrib(GSCHEM_TOPLEVEL *w_current,
   /* now attach the attribute to the object (if o_current is not NULL) */
   /* remember that o_current contains the object to get the attribute */
   if (o_current) {
-    o_attrib_attach(toplevel, toplevel->page_current->object_head,
-                    toplevel->page_current->object_tail,
-                    o_current);
+    o_attrib_attach (toplevel, toplevel->page_current->object_tail, o_current);
   }
 
   o_selection_add( toplevel->page_current->selection_list,
diff --git a/gschem/src/o_slot.c b/gschem/src/o_slot.c
index 4b12984..3546e11 100644
--- a/gschem/src/o_slot.c
+++ b/gschem/src/o_slot.c
@@ -200,10 +200,7 @@ void o_slot_end(GSCHEM_TOPLEVEL *w_current, const char *string, int len)
       /* manually attach attribute */
 
       /* NEWSEL this is okay too, since tail is single obj */
-      o_attrib_attach(toplevel,
-                      toplevel->page_current->object_head,
-                      toplevel->page_current->object_tail,
-                      object);
+      o_attrib_attach (toplevel, toplevel->page_current->object_tail, object);
 
       slot_text_object =
         toplevel->page_current->object_tail;
diff --git a/libgeda/include/prototype.h b/libgeda/include/prototype.h
index 14c037f..3f279a3 100644
--- a/libgeda/include/prototype.h
+++ b/libgeda/include/prototype.h
@@ -100,7 +100,7 @@ void o_arc_mirror_world(TOPLEVEL *toplevel, int world_centerx, int world_centery
 OBJECT *o_attrib_search(GList *list, OBJECT *item);
 void o_attrib_add(TOPLEVEL *toplevel, OBJECT *object, OBJECT *item);
 void o_attrib_free(TOPLEVEL *toplevel, OBJECT *current);
-void o_attrib_attach(TOPLEVEL *toplevel, OBJECT *parent_list, OBJECT *attrib, OBJECT *object);
+void o_attrib_attach(TOPLEVEL *toplevel, OBJECT *attrib, OBJECT *object);
 void o_attrib_free_all(TOPLEVEL *toplevel, GList *list);
 void o_attrib_print(GList *attributes);
 void o_attrib_remove(GList **list, OBJECT *remove);
diff --git a/libgeda/src/o_attrib.c b/libgeda/src/o_attrib.c
index 9fdb669..3d5af50 100644
--- a/libgeda/src/o_attrib.c
+++ b/libgeda/src/o_attrib.c
@@ -155,22 +155,11 @@ void o_attrib_free(TOPLEVEL *toplevel, OBJECT *current)
  *  Attach existing attribute to an object.
  *
  *  \param [in]  toplevel     The TOPLEVEL object.
- *  \param [in]  parent_list  List where actual attribute objects live.
  *  \param [in]  attrib       The attribute to be added.
  *  \param [out] object       The object where you want to add item as an attribute.
- *
- *  \par IMPORTANT:
- *  Lists first then specific single item.
- *
- *  \note
- *  typically parent_list is object_parent (object_head), but it is
- *  overridden in o_complex_add so that it points to head node of the complex
  */
-void o_attrib_attach (TOPLEVEL *toplevel, OBJECT *parent_list,
-                      OBJECT *attrib, OBJECT *object)
+void o_attrib_attach (TOPLEVEL *toplevel, OBJECT *attrib, OBJECT *object)
 {
-  OBJECT *found = NULL; /* object in main list */
-
   g_return_if_fail (attrib != NULL);
   g_return_if_fail (object != NULL);
 
@@ -180,26 +169,18 @@ void o_attrib_attach (TOPLEVEL *toplevel, OBJECT *parent_list,
     return;
   }
 
-  found = (OBJECT *) o_list_search(parent_list, attrib);
-
-  /* check to see if found is not null hack */
-  if (!found) {
-    g_critical ("o_attrib_attach(): attrib was not found in parent_list\n");
-    return;
-  }
-
-  if (found->type != OBJ_TEXT) {
+  if (attrib->type != OBJ_TEXT) {
     g_warning (_("Attempt to attach non text item as an attribute!\n"));
     return;
   }
 
-  if (found->attached_to != NULL) {
+  if (attrib->attached_to != NULL) {
     g_warning (_("Attempt to attach attribute [%s] to more than one object\n"),
-                found->text->string);
+                attrib->text->string);
     return;
   }
 
-  o_attrib_add (toplevel, object, found);
+  o_attrib_add (toplevel, object, attrib);
 
   attrib->color = toplevel->attribute_color;
   o_complex_set_color(attrib->text->prim_objs, attrib->color);
@@ -401,9 +382,7 @@ OBJECT *o_read_attribs(TOPLEVEL *toplevel,
     }
 
     if (ATTACH) {
-      o_attrib_attach(toplevel,
-                      toplevel->page_current->object_parent,
-                      object_list, object_to_get_attribs);
+      o_attrib_attach(toplevel, object_list, object_to_get_attribs);
       /* check color to set it to the right value */
       if (object_list->color != saved_color) {
         object_list->color = saved_color;
diff --git a/libgeda/src/o_complex_basic.c b/libgeda/src/o_complex_basic.c
index fb62c76..c02ee0a 100644
--- a/libgeda/src/o_complex_basic.c
+++ b/libgeda/src/o_complex_basic.c
@@ -477,21 +477,13 @@ OBJECT *o_complex_add(TOPLEVEL *toplevel, OBJECT *object_list,
 
           /* Isolate tmp completely, now that it's removed from list */
           tmp->next=tmp->prev=NULL;
-	  if (use_object_list) {
-	    object_list = (OBJECT *) s_basic_link_object(tmp, object_list);
-	    o_attrib_attach (toplevel, object_list, tmp, new_node);
-	  }
-	  else {
-	    if (object_glist) {
-	      *object_glist = g_list_append (*object_glist, tmp);
-              o_glist_relink_objects (*object_glist);
-
-	      o_attrib_attach (toplevel, ((OBJECT *) g_list_last(*object_glist)->data),
-			       tmp, new_node);
-	    } else {
-	      o_attrib_attach (toplevel, NULL, tmp, new_node);
-	    }
-	  }
+          if (use_object_list) {
+            object_list = (OBJECT *) s_basic_link_object(tmp, object_list);
+          } else if (object_glist) {
+            *object_glist = g_list_append (*object_glist, tmp);
+            o_glist_relink_objects (*object_glist);
+          }
+          o_attrib_attach (toplevel, tmp, new_node);
           o_text_translate_world(toplevel, x, y, tmp);
 
         } else { /* not promoting, hide or delete promotable attribs */
diff --git a/libgeda/src/o_list.c b/libgeda/src/o_list.c
index e1b72e3..b07d414 100644
--- a/libgeda/src/o_list.c
+++ b/libgeda/src/o_list.c
@@ -193,8 +193,7 @@ OBJECT *o_list_copy_all(TOPLEVEL *toplevel, OBJECT *src_list_head,
 
       if (src->attached_to /*&& !toplevel->ADDING_SEL*/) {
         if (src->attached_to->copied_to) {
-          o_attrib_attach(toplevel, dest_list_head,
-                          dest, src->attached_to->copied_to);
+          o_attrib_attach(toplevel, dest, src->attached_to->copied_to);
         }
       }
     }
@@ -307,9 +306,8 @@ GList *o_glist_copy_all_to_glist(TOPLEVEL *toplevel,
 
       if (src_object->attached_to /*&& !toplevel->ADDING_SEL*/) {
         if (src_object->attached_to->copied_to) {
-          o_attrib_attach(toplevel,
-                          (OBJECT *)dest->data, /* This param is a hack */
-                          dst_object, src_object->attached_to->copied_to);
+          o_attrib_attach(toplevel, dst_object,
+                          src_object->attached_to->copied_to);
         }
       }
     }




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