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

gEDA-cvs: gaf.git: branch: master updated (1.5.0-20080706-175-gb14f3bf)



The branch, master has been updated
       via  b14f3bf215963529b89f650ff3bd6f0b0c90450f (commit)
      from  acb96234eed1e51ab22b17cd718d5f627d292a96 (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
=========

 gschem/src/x_multiattrib.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)


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

commit b14f3bf215963529b89f650ff3bd6f0b0c90450f
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Sep 24 00:57:57 2008 +0100

    gschem: Don't add invalid attributes to the multiattrib dialog list
    
    Since we can't edit them, don't treat them as attributes.
    
    Gschem validates attributes upon creation, so an invalid attribute
    attached to an object must come from a hand-edited file, or a text
    object which has been attached to an object. (Validation that the
    text item is a valid attribute isn't performed in that code-path).
    
    In the future we might want to add validation of attributes at
    file-load and at before attaching text OBJECTs to a COMPLEX.

:100644 100644 306d2a9... 8daff33... M	gschem/src/x_multiattrib.c

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

commit b14f3bf215963529b89f650ff3bd6f0b0c90450f
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Wed Sep 24 00:57:57 2008 +0100

    gschem: Don't add invalid attributes to the multiattrib dialog list
    
    Since we can't edit them, don't treat them as attributes.
    
    Gschem validates attributes upon creation, so an invalid attribute
    attached to an object must come from a hand-edited file, or a text
    object which has been attached to an object. (Validation that the
    text item is a valid attribute isn't performed in that code-path).
    
    In the future we might want to add validation of attributes at
    file-load and at before attaching text OBJECTs to a COMPLEX.

diff --git a/gschem/src/x_multiattrib.c b/gschem/src/x_multiattrib.c
index 306d2a9..8daff33 100644
--- a/gschem/src/x_multiattrib.c
+++ b/gschem/src/x_multiattrib.c
@@ -1888,6 +1888,7 @@ static void multiattrib_get_property (GObject *object,
  */
 void multiattrib_update (Multiattrib *multiattrib)
 {
+  TOPLEVEL *toplevel;
   GtkListStore *liststore;
   GtkTreeIter iter;
   OBJECT **object_attribs, *o_current;
@@ -1896,6 +1897,7 @@ void multiattrib_update (Multiattrib *multiattrib)
   GtkStyle *style;
 
   g_assert (GSCHEM_DIALOG (multiattrib)->w_current != NULL);
+  toplevel = GSCHEM_DIALOG (multiattrib)->w_current->toplevel;
 
   /* clear the list of attributes */
   liststore = (GtkListStore*)gtk_tree_view_get_model (multiattrib->treeview);
@@ -1925,6 +1927,12 @@ void multiattrib_update (Multiattrib *multiattrib)
     for (i = 0, o_current = object_attribs[i];
          o_current != NULL;
          i++, o_current = object_attribs[i]) {
+
+      /* Don't add invalid attributes to the list */
+      if (!o_attrib_get_name_value (o_text_get_string (toplevel, o_current),
+                                    NULL, NULL))
+        continue;
+
       gtk_list_store_append (liststore, &iter);
       gtk_list_store_set (liststore, &iter,
                           COLUMN_ATTRIBUTE, o_current,




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