r5420 - trunk/eda/fped

werner at docs.openmoko.org werner at docs.openmoko.org
Tue Aug 11 23:54:18 CEST 2009


Author: werner
Date: 2009-08-11 23:54:18 +0200 (Tue, 11 Aug 2009)
New Revision: 5420

Modified:
   trunk/eda/fped/gui_meas.c
   trunk/eda/fped/gui_tool.c
   trunk/eda/fped/gui_tool.h
Log:
- measurements entered through the GUI were connected to the active frame, not
  the root frame



Modified: trunk/eda/fped/gui_meas.c
===================================================================
--- trunk/eda/fped/gui_meas.c	2009-08-11 20:52:33 UTC (rev 5419)
+++ trunk/eda/fped/gui_meas.c	2009-08-11 21:54:18 UTC (rev 5420)
@@ -269,7 +269,8 @@
 	if (from == to)
 		return 0;
 	/* it's safe to pass "from" here, but we may change it later */
-	obj = new_obj(ot_meas, from);
+	obj = new_obj_unconnected(ot_meas, from);
+	connect_obj(root_frame, obj);
 	meas = &obj->u.meas;
 	meas->label = NULL;
 	switch (mode) {

Modified: trunk/eda/fped/gui_tool.c
===================================================================
--- trunk/eda/fped/gui_tool.c	2009-08-11 20:52:33 UTC (rev 5419)
+++ trunk/eda/fped/gui_tool.c	2009-08-11 21:54:18 UTC (rev 5420)
@@ -83,9 +83,9 @@
 }
 
 
-struct obj *new_obj(enum obj_type type, struct inst *base)
+struct obj *new_obj_unconnected(enum obj_type type, struct inst *base)
 {
-	struct obj *obj, **walk;
+	struct obj *obj;
 
 	obj = alloc_type(struct obj);
 	obj->type = type;
@@ -93,8 +93,25 @@
 	obj->base = inst_get_vec(base);
 	obj->next = NULL;
 	obj->lineno = 0;
-	for (walk = &active_frame->objs; *walk; walk = &(*walk)->next);
+	return obj;
+}
+
+
+void connect_obj(struct frame *frame, struct obj *obj)
+{
+	struct obj **walk;
+
+	for (walk = &frame->objs; *walk; walk = &(*walk)->next);
 	*walk = obj;
+}
+
+
+static struct obj *new_obj(enum obj_type type, struct inst *base)
+{
+	struct obj *obj;
+
+	obj = new_obj_unconnected(type, base);
+	connect_obj(active_frame, obj);
 	return obj;
 }
 

Modified: trunk/eda/fped/gui_tool.h
===================================================================
--- trunk/eda/fped/gui_tool.h	2009-08-11 20:52:33 UTC (rev 5419)
+++ trunk/eda/fped/gui_tool.h	2009-08-11 21:54:18 UTC (rev 5420)
@@ -57,7 +57,8 @@
  * compilation unit.
  */
 
-struct obj *new_obj(enum obj_type type, struct inst *base);
+struct obj *new_obj_unconnected(enum obj_type type, struct inst *base);
+void connect_obj(struct frame *frame, struct obj *obj);
 struct pix_buf *draw_move_line_common(struct inst *inst,
     struct coord end, struct coord pos, int i);
 struct pix_buf *drag_new_line(struct inst *from, struct coord to);




More information about the commitlog mailing list