[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: branch: master updated (1.4.0-20080127-1-g22396b2)
The branch, master has been updated
via 22396b286d50c454287ff94a3c3de414b3f9a08a (commit)
from b202ee510fb90cedd038ce5ec41cc6de453dbeea (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/o_delete.c | 7 ++++++-
gschem/src/x_autonumber.c | 2 --
libgeda/src/o_attrib.c | 25 +++++++++++++++++--------
3 files changed, 23 insertions(+), 11 deletions(-)
=================
Commit Messages
=================
commit 22396b286d50c454287ff94a3c3de414b3f9a08a
Author: Werner Hoch <werner.ho@xxxxxx>
Date: Sat Jan 26 19:27:15 2008 +0100
update the pinnumbers if a slot attribute is deleted
Update the slots whenever a text line that is attached to an object
gets deleted. The update checks the slotting even if there's no slot
attribut. This catches the case when the user deletes a slot attribute
and the current displayed pinnumbers are not the ones defined in the
symbol. This commit fixes [#1880221]
:100644 100644 1030f08... 60f6f38... M gschem/src/o_delete.c
:100644 100644 c02d35d... 017af04... M gschem/src/x_autonumber.c
:100644 100644 7a59ace... e54c5ba... M libgeda/src/o_attrib.c
=========
Changes
=========
commit 22396b286d50c454287ff94a3c3de414b3f9a08a
Author: Werner Hoch <werner.ho@xxxxxx>
Date: Sat Jan 26 19:27:15 2008 +0100
update the pinnumbers if a slot attribute is deleted
Update the slots whenever a text line that is attached to an object
gets deleted. The update checks the slotting even if there's no slot
attribut. This catches the case when the user deletes a slot attribute
and the current displayed pinnumbers are not the ones defined in the
symbol. This commit fixes [#1880221]
diff --git a/gschem/src/o_delete.c b/gschem/src/o_delete.c
index 1030f08..60f6f38 100644
--- a/gschem/src/o_delete.c
+++ b/gschem/src/o_delete.c
@@ -208,11 +208,16 @@ static void o_delete_circle(GSCHEM_TOPLEVEL *w_current, OBJECT *obj)
void o_delete_text(GSCHEM_TOPLEVEL *w_current, OBJECT *obj)
{
TOPLEVEL *toplevel = w_current->toplevel;
+ OBJECT *o_parent = obj->attached_to;
+
o_erase_single(w_current, obj);
s_delete(toplevel, obj);
toplevel->page_current->object_tail =
- (OBJECT *) return_tail(toplevel->page_current->object_head);
+ (OBJECT *) return_tail(toplevel->page_current->object_head);
+
+ if (o_parent != NULL)
+ o_attrib_slot_update(toplevel, o_parent);
}
/*! \todo Finish function documentation!!!
diff --git a/gschem/src/x_autonumber.c b/gschem/src/x_autonumber.c
index c02d35d..017af04 100644
--- a/gschem/src/x_autonumber.c
+++ b/gschem/src/x_autonumber.c
@@ -587,8 +587,6 @@ void autonumber_remove_number(AUTONUMBER_TEXT * autotext, OBJECT *o_current)
/* delete the slot attribute */
o_selection_remove (autotext->w_current->toplevel->page_current->selection_list, o_slot);
o_delete_text (autotext->w_current, o_slot);
- /* redraw the slotted object. So that the pinnumbers appear as with slot=1 */
- /* --> No: should be done by o_delete_text as several dialog use it. */
}
}
}
diff --git a/libgeda/src/o_attrib.c b/libgeda/src/o_attrib.c
index 7a59ace..e54c5ba 100644
--- a/libgeda/src/o_attrib.c
+++ b/libgeda/src/o_attrib.c
@@ -1665,6 +1665,7 @@ void o_attrib_slot_update(TOPLEVEL *toplevel, OBJECT *object)
char *string;
char *slotdef;
int slot;
+ int slot_string;
int pin_counter; /* Internal pin counter private to this fcn. */
char* current_pin; /* text from slotdef= to be made into pinnumber= */
char* cptr; /* char pointer pointing to pinnumbers in slotdef=#:#,#,# string */
@@ -1673,21 +1674,29 @@ void o_attrib_slot_update(TOPLEVEL *toplevel, OBJECT *object)
/* For this particular graphic object (component instantiation) */
/* get the slot number as a string */
string = o_attrib_search_slot(o_current, &o_slot_attrib);
-
+
if (!string) {
- /* s_log_message("Did not find slot= attribute\n"); */
- /* not a serious error */
- return;
+ /* "Did not find slot= attribute", this is true if
+ * * there is no slot attribut
+ * * or the slot attribute was deleted and we have to assume to use the
+ * first slot now
+ */
+ slot = 1;
+ slot_string = 0;
}
- slot = atoi(string);
- g_free(string);
+ else {
+ slot_string = 1;
+ slot = atoi(string);
+ g_free(string);
+ }
/* OK, now that we have the slot number, use it to get the */
/* corresponding slotdef=#:#,#,# string. */
slotdef = o_attrib_search_slotdef(o_current, slot);
- if (!slotdef) {
- s_log_message(_("Did not find slotdef=#:#,#,#... attribute\n"));
+ if (!slotdef) {
+ if (slot_string) /* only an error if there's a slot string */
+ s_log_message(_("Did not find slotdef=#:#,#,#... attribute\n"));
return;
}
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs