Index: trunk/src/obj_arc.c =================================================================== --- trunk/src/obj_arc.c (revision 10899) +++ trunk/src/obj_arc.c (revision 10900) @@ -56,6 +56,7 @@ new_obj = calloc(sizeof(pcb_arc_t), 1); new_obj->type = PCB_OBJ_ARC; + new_obj->Attributes.post_change = pcb_obj_attrib_post_change; PCB_SET_PARENT(new_obj, layer, layer); arclist_append(&layer->Arc, new_obj); Index: trunk/src/obj_common.c =================================================================== --- trunk/src/obj_common.c (revision 10899) +++ trunk/src/obj_common.c (revision 10900) @@ -28,6 +28,7 @@ #include "config.h" +#include #include "conf_core.h" #include "global_typedefs.h" #include "const.h" @@ -146,3 +147,10 @@ *y = (obj->BoundingBox.Y1 + obj->BoundingBox.Y2) / 2; } } + +void pcb_obj_attrib_post_change(pcb_attribute_list_t *list, const char *name, const char *value) +{ + pcb_any_obj_t *obj = (pcb_any_obj_t *)(((char *)list) - offsetof(pcb_any_obj_t, Attributes)); + if (strcmp(name, "term") == 0) + obj->term = value; +} Index: trunk/src/obj_common.h =================================================================== --- trunk/src/obj_common.h (revision 10899) +++ trunk/src/obj_common.h (revision 10900) @@ -158,6 +158,9 @@ /* Return the geometric center of an object (center of bbox usually) */ void pcb_obj_center(pcb_any_obj_t *obj, pcb_coord_t *x, pcb_coord_t *y); +/* Update cached attributes (->term) */ +void pcb_obj_attrib_post_change(pcb_attribute_list_t *list, const char *name, const char *value); + /* compare two fields and return 0 if they are equal */ #define pcb_field_neq(s1, s2, f) ((s1)->f != (s2)->f) Index: trunk/src/obj_line.c =================================================================== --- trunk/src/obj_line.c (revision 10899) +++ trunk/src/obj_line.c (revision 10900) @@ -60,6 +60,7 @@ new_obj = calloc(sizeof(pcb_line_t), 1); new_obj->type = PCB_OBJ_LINE; + new_obj->Attributes.post_change = pcb_obj_attrib_post_change; PCB_SET_PARENT(new_obj, layer, layer); linelist_append(&layer->Line, new_obj); Index: trunk/src/obj_pinvia.c =================================================================== --- trunk/src/obj_pinvia.c (revision 10899) +++ trunk/src/obj_pinvia.c (revision 10900) @@ -55,6 +55,7 @@ new_obj = calloc(sizeof(pcb_pin_t), 1); new_obj->type = PCB_OBJ_VIA; + new_obj->Attributes.post_change = pcb_obj_attrib_post_change; PCB_SET_PARENT(new_obj, data, data); pinlist_append(&data->Via, new_obj); Index: trunk/src/obj_poly.c =================================================================== --- trunk/src/obj_poly.c (revision 10899) +++ trunk/src/obj_poly.c (revision 10900) @@ -61,6 +61,7 @@ new_obj = calloc(sizeof(pcb_polygon_t), 1); new_obj->type = PCB_OBJ_POLYGON; + new_obj->Attributes.post_change = pcb_obj_attrib_post_change; PCB_SET_PARENT(new_obj, layer, layer); polylist_append(&layer->Polygon, new_obj); Index: trunk/src/obj_text.c =================================================================== --- trunk/src/obj_text.c (revision 10899) +++ trunk/src/obj_text.c (revision 10900) @@ -60,6 +60,7 @@ new_obj = calloc(sizeof(pcb_text_t), 1); new_obj->type = PCB_OBJ_TEXT; + new_obj->Attributes.post_change = pcb_obj_attrib_post_change; PCB_SET_PARENT(new_obj, layer, layer); textlist_append(&layer->Text, new_obj);