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

gEDA-cvs: gaf.git: branch: master updated (1.6.0-20091004-38-g16090ce)



The branch, master has been updated
       via  16090ce2eedc014d82e96fd340ec27f9ea6b186d (commit)
       via  2eae6d63738a0a27578e2868d788d59313d75583 (commit)
       via  f1a5270236c98274f3d02a1513823fd9a8ff707f (commit)
      from  b50377f6c0438e49b9dff0a2be8dc01df51dfd55 (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/include/prototype.h |    1 +
 gschem/src/o_complex.c     |   18 ++++--------
 gschem/src/o_misc.c        |   61 +++++++++++++++++++++++--------------------
 gschem/src/o_move.c        |    2 -
 gschem/src/o_place.c       |   14 ++++------
 5 files changed, 46 insertions(+), 50 deletions(-)


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

commit 16090ce2eedc014d82e96fd340ec27f9ea6b186d
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    gschem: Don't update page connectivity from o_place_rotate()  Bug #2904715
    
    This fixes bug #2904715, where gschem would crash if an object being
    multi-copied contained nets, and the place-buffer was rotated (by 90
    degrees) four times during the place operation.
    
    Items in the place list should never have their connectivity updated
    on the page. (They don't belong to the page, so have no business
    being referenced from the page, or objects on it).
    
    Rather than calling o_rotate_world_update() (which updates connectivity)
    call o_glist_rotate_world() and then the scheme rotate hooks explictly.
    
    Rotate hook handling was split from o_rotate_world_update() into a new
    function, o_rotate_call_hooks(). When doing this split, I took the
    chance to remove a few pointless tests of o_current != NULL in there.
    We know o_current isn't going to be NULL, and we already dereferenced
    it (unchecked) a few lines above.
    
    As o_place_rotate() is always called from within an action - and in
    those cases, o_rotate_world_update() would not update the undo list,
    I have not included the conditional undo update in o_place_rotate().

:100644 100644 81e6a3b... 4983e1f... M	gschem/include/prototype.h
:100644 100644 a0f652a... 9df8f00... M	gschem/src/o_misc.c
:100644 100644 de27598... c19c0a7... M	gschem/src/o_place.c

commit 2eae6d63738a0a27578e2868d788d59313d75583
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    gschem: Don't duplicate registration of new zero-length rubber-band nets
    
    o_net_new() adds the net into the tile system and updates conectivity
    (assuming toplevel->ADDING_SEL is false).

:100644 100644 fd3ea85... 6d57f4a... M	gschem/src/o_move.c

commit f1a5270236c98274f3d02a1513823fd9a8ff707f
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    libgeda: Tidy up some calls in o_complex_translate_all()
    
    Convert a couple of short while loops over a GList into a for() structure.
    Remove a completely redundant if statement. The if () {...} and else {...}
    branches had the same code in them!

:100644 100644 95410ee... 30f12d4... M	gschem/src/o_complex.c

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

commit 16090ce2eedc014d82e96fd340ec27f9ea6b186d
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    gschem: Don't update page connectivity from o_place_rotate()  Bug #2904715
    
    This fixes bug #2904715, where gschem would crash if an object being
    multi-copied contained nets, and the place-buffer was rotated (by 90
    degrees) four times during the place operation.
    
    Items in the place list should never have their connectivity updated
    on the page. (They don't belong to the page, so have no business
    being referenced from the page, or objects on it).
    
    Rather than calling o_rotate_world_update() (which updates connectivity)
    call o_glist_rotate_world() and then the scheme rotate hooks explictly.
    
    Rotate hook handling was split from o_rotate_world_update() into a new
    function, o_rotate_call_hooks(). When doing this split, I took the
    chance to remove a few pointless tests of o_current != NULL in there.
    We know o_current isn't going to be NULL, and we already dereferenced
    it (unchecked) a few lines above.
    
    As o_place_rotate() is always called from within an action - and in
    those cases, o_rotate_world_update() would not update the undo list,
    I have not included the conditional undo update in o_place_rotate().

diff --git a/gschem/include/prototype.h b/gschem/include/prototype.h
index 81e6a3b..4983e1f 100644
--- a/gschem/include/prototype.h
+++ b/gschem/include/prototype.h
@@ -613,6 +613,7 @@ void o_edit(GSCHEM_TOPLEVEL *w_current, GList *list);
 void o_lock(GSCHEM_TOPLEVEL *w_current);
 void o_unlock(GSCHEM_TOPLEVEL *w_current);
 void o_rotate_world_update(GSCHEM_TOPLEVEL *w_current, int centerx, int centery, int angle, GList *list);
+void o_rotate_call_hooks(GSCHEM_TOPLEVEL *w_current, GList *list);
 void o_mirror_world_update(GSCHEM_TOPLEVEL *w_current, int centerx, int centery, GList *list);
 void o_edit_show_hidden_lowlevel(GSCHEM_TOPLEVEL *w_current, const GList *o_list);
 void o_edit_show_hidden(GSCHEM_TOPLEVEL *w_current, const GList *o_list);
diff --git a/gschem/src/o_misc.c b/gschem/src/o_misc.c
index a0f652a..9df8f00 100644
--- a/gschem/src/o_misc.c
+++ b/gschem/src/o_misc.c
@@ -240,50 +240,55 @@ void o_rotate_world_update(GSCHEM_TOPLEVEL *w_current,
   g_list_free (connected_objects);
   connected_objects = NULL;
 
-  /* All objects were rotated. Do a 2nd pass to run the rotate hooks */
+  /* All objects were rotated. Run the rotate hooks */
+  o_rotate_call_hooks (w_current, list);
+
+  /* Don't save the undo state if we are inside an action */
+  /* This is useful when rotating the selection while moving, for example */
+  toplevel->page_current->CHANGED = 1;
+  if (!w_current->inside_action) {
+    o_undo_savestate(w_current, UNDO_ALL);
+  }
+}
+
+
+void o_rotate_call_hooks (GSCHEM_TOPLEVEL *w_current, GList *list)
+{
+  TOPLEVEL *toplevel = w_current->toplevel;
+  OBJECT *o_current;
+  GList *iter;
+
   /* Do not run any hooks for simple objects here, like text, since they
      were rotated in the previous pass, and the selection list can contain
      an object and all its attributes (text) */
-  o_iter = list;
-  while (o_iter != NULL) {
-    o_current = o_iter->data;
+  for (iter = list; iter != NULL; iter = g_list_next (iter)) {
+    o_current = iter->data;
 
-    switch(o_current->type) {
-      case(OBJ_PIN):
+    switch (o_current->type) {
+      case OBJ_PIN:
         /* Run the rotate pin hook */
-        if (scm_hook_empty_p(rotate_pin_hook) == SCM_BOOL_F &&
-            o_current != NULL) {
-          scm_run_hook(rotate_pin_hook,
-                       scm_cons(g_make_object_smob(toplevel, o_current),
-                                SCM_EOL));
+        if (scm_hook_empty_p (rotate_pin_hook) == SCM_BOOL_F) {
+          scm_run_hook (rotate_pin_hook,
+                        scm_cons (g_make_object_smob (toplevel, o_current),
+                                  SCM_EOL));
         }
         break;
 
-      case (OBJ_COMPLEX):
+      case OBJ_COMPLEX:
         /* Run the rotate hook */
-        if (scm_hook_empty_p(rotate_component_object_hook) == SCM_BOOL_F &&
-            o_current != NULL) {
-          scm_run_hook(rotate_component_object_hook,
-                       scm_cons(g_make_object_smob(toplevel, o_current),
-                                SCM_EOL));
+        if (scm_hook_empty_p (rotate_component_object_hook) == SCM_BOOL_F) {
+          scm_run_hook (rotate_component_object_hook,
+                        scm_cons (g_make_object_smob (toplevel, o_current),
+                                  SCM_EOL));
         }
         break;
-    default:
+
+      default:
         break;
     }
-
-    o_iter = g_list_next(o_iter);
-  }
-
-  /* Don't save the undo state if we are inside an action */
-  /* This is useful when rotating the selection while moving, for example */
-  toplevel->page_current->CHANGED = 1;
-  if (!w_current->inside_action) {
-    o_undo_savestate(w_current, UNDO_ALL);
   }
 }
 
-
 /*! \todo Finish function documentation!!!
  *  \brief
  *  \par Function Description
diff --git a/gschem/src/o_place.c b/gschem/src/o_place.c
index de27598..c19c0a7 100644
--- a/gschem/src/o_place.c
+++ b/gschem/src/o_place.c
@@ -319,12 +319,10 @@ void o_place_draw_rubber (GSCHEM_TOPLEVEL *w_current, int drawing)
 void o_place_rotate (GSCHEM_TOPLEVEL *w_current)
 {
   TOPLEVEL *toplevel = w_current->toplevel;
-  int savestate;
-
-  savestate = toplevel->DONT_REDRAW;
-  toplevel->DONT_REDRAW = 1;
-  o_rotate_world_update (w_current,
-                         w_current->first_wx, w_current->first_wy,
-                         90, toplevel->page_current->place_list);
-  toplevel->DONT_REDRAW = savestate;
+
+  o_glist_rotate_world (toplevel,
+                        w_current->first_wx, w_current->first_wy, 90,
+                        toplevel->page_current->place_list);
+  /* All objects were rotated. Run the rotate hooks */
+  o_rotate_call_hooks (w_current, toplevel->page_current->place_list);
 }

commit 2eae6d63738a0a27578e2868d788d59313d75583
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    gschem: Don't duplicate registration of new zero-length rubber-band nets
    
    o_net_new() adds the net into the tile system and updates conectivity
    (assuming toplevel->ADDING_SEL is false).

diff --git a/gschem/src/o_move.c b/gschem/src/o_move.c
index fd3ea85..6d57f4a 100644
--- a/gschem/src/o_move.c
+++ b/gschem/src/o_move.c
@@ -521,8 +521,6 @@ void o_move_check_endpoint(GSCHEM_TOPLEVEL *w_current, OBJECT * object)
                            c_current->x, c_current->y,
                            c_current->x, c_current->y);
       s_page_append (toplevel, toplevel->page_current, new_net);
-      s_tile_add_object (toplevel, new_net);
-      s_conn_update_object (toplevel, new_net);
       /* This new net object is only picked up for stretching later,
        * somewhat of a kludge. If the move operation is cancelled, these
        * new 0 length nets are removed by the "undo" operation invoked.

commit f1a5270236c98274f3d02a1513823fd9a8ff707f
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    libgeda: Tidy up some calls in o_complex_translate_all()
    
    Convert a couple of short while loops over a GList into a for() structure.
    Remove a completely redundant if statement. The if () {...} and else {...}
    branches had the same code in them!

diff --git a/gschem/src/o_complex.c b/gschem/src/o_complex.c
index 95410ee..30f12d4 100644
--- a/gschem/src/o_complex.c
+++ b/gschem/src/o_complex.c
@@ -238,13 +238,12 @@ void o_complex_translate_all(GSCHEM_TOPLEVEL *w_current, int offset)
    * the correct sense) were in use . */
   y = snap_grid (w_current, w_rtop);
 
-  iter = s_page_objects (toplevel->page_current);
-  while (iter != NULL) {
+  for (iter = s_page_objects (toplevel->page_current);
+       iter != NULL; iter = g_list_next (iter)) {
     o_current = iter->data;
     s_conn_remove_object (toplevel, o_current);
-    iter = g_list_next (iter);
   }
-        
+
   if (offset == 0) {
     s_log_message(_("Translating schematic [%d %d]\n"), -x, -y);
     o_glist_translate_world (toplevel, -x, -y,
@@ -256,15 +255,10 @@ void o_complex_translate_all(GSCHEM_TOPLEVEL *w_current, int offset)
                              s_page_objects (toplevel->page_current));
   }
 
-  iter = s_page_objects (toplevel->page_current);
-  while (iter != NULL) {
+  for (iter = s_page_objects (toplevel->page_current);
+       iter != NULL;  iter = g_list_next (iter)) {
     o_current = iter->data;
-    if (o_current->type != OBJ_COMPLEX && o_current->type != OBJ_PLACEHOLDER) {
-      s_conn_update_object (toplevel, o_current);
-    } else {
-      s_conn_update_object (toplevel, o_current);
-    }
-    iter = g_list_next (iter);
+    s_conn_update_object (toplevel, o_current);
   }
 
   /* this is an experimental mod, to be able to translate to all




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