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

gEDA-cvs: branch: master updated (1.1.2.20070818-153-gc290fcb)



The branch, master has been updated
       via  c290fcbcb34bd4adaee35a7ba4f655f88e4e252a (commit)
       via  17998a71cc46a7eff3c738fcbd3851c7c8ea5930 (commit)
       via  83b4c4f7d62c8a0a6a52ec092c9535f81f82deac (commit)
       via  95a9632f6b4970b578fe06647496f339ee5fa1f8 (commit)
      from  fb274693d442e16890582d7442f1d52d60e95755 (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/i_callbacks.c  |    3 +-
 gschem/src/o_basic.c      |   78 ++++++++++++++++++++++++++-------------------
 gschem/src/x_compselect.c |   30 ++++++-----------
 3 files changed, 57 insertions(+), 54 deletions(-)


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

commit c290fcbcb34bd4adaee35a7ba4f655f88e4e252a
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Mon Dec 17 23:11:47 2007 +0000

    Check if bounds were found before invalidating drawn areas.
    
    If world_get_..._bounds() return zero (for example, in the case of
    invisible attributes, or an empty schematic), no bound coordinates
    are returned and we can't use them for further processing.

:100644 100644 d204b9c... 16cde6b... M	gschem/src/o_basic.c

commit 17998a71cc46a7eff3c738fcbd3851c7c8ea5930
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Mon Dec 17 23:11:44 2007 +0000

    Fix bug #1851403: Crash after adding component while in move mode
    
    Ensure any operation already in progress when opening the component
    selector is cancelled by calling o_redraw_cleanstates() first.
    
    Also call o_redraw_cleanstates() just before placing the component,
    rather then directly freeing the objects in the complex place list.
    Since the component selector isn't modal, the user may have switched
    to a different action whilst the component selector was open.
    
    To avoid a similar crash, use o_redraw_cleanstates() upon closing the
    component selector (if we are still in component placement mode).

:100644 100644 a62427c... f691eb4... M	gschem/src/i_callbacks.c
:100644 100644 f0f9b10... abeae9d... M	gschem/src/x_compselect.c

commit 83b4c4f7d62c8a0a6a52ec092c9535f81f82deac
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Mon Dec 17 23:03:53 2007 +0000

    Fix memory leak in o_redraw_cleanstates() called during copy or place.
    
    For actions other than "MOVE", the objects in the complex_place_list
    must be free'd as they are otherwise unowned.

:100644 100644 4a89849... d204b9c... M	gschem/src/o_basic.c

commit 95a9632f6b4970b578fe06647496f339ee5fa1f8
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Mon Dec 17 23:03:49 2007 +0000

    Fix i_callback_edit_copy_hotkey() to set new state after clearing old.
    
    o_redraw_cleanstates() needs to know the state it's clearing up.

:100644 100644 c404790... a62427c... M	gschem/src/i_callbacks.c

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

commit c290fcbcb34bd4adaee35a7ba4f655f88e4e252a
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Mon Dec 17 23:11:47 2007 +0000

    Check if bounds were found before invalidating drawn areas.
    
    If world_get_..._bounds() return zero (for example, in the case of
    invisible attributes, or an empty schematic), no bound coordinates
    are returned and we can't use them for further processing.

diff --git a/gschem/src/o_basic.c b/gschem/src/o_basic.c
index d204b9c..16cde6b 100644
--- a/gschem/src/o_basic.c
+++ b/gschem/src/o_basic.c
@@ -118,10 +118,12 @@ void o_redraw(GSCHEM_TOPLEVEL *w_current, OBJECT *list, gboolean draw_selected)
   w_current->inside_redraw = 0;
   toplevel->DONT_REDRAW = redraw_state;
 
-  world_get_object_list_bounds(toplevel, list, &left, &top, &right, &bottom);
-  WORLDtoSCREEN( toplevel, left, top, &s_left, &s_top );
-  WORLDtoSCREEN( toplevel, right, bottom, &s_right, &s_bottom );
-  o_invalidate_rect( w_current, s_left, s_top, s_right, s_bottom );
+  if (world_get_object_list_bounds(toplevel, list, &left,  &top,
+                                                   &right, &bottom)) {
+    WORLDtoSCREEN( toplevel, left, top, &s_left, &s_top );
+    WORLDtoSCREEN( toplevel, right, bottom, &s_right, &s_bottom );
+    o_invalidate_rect( w_current, s_left, s_top, s_right, s_bottom );
+  }
 }
 
 /*! \brief Redraw an object on the screen.
@@ -150,12 +152,12 @@ void o_redraw_single(GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
     w_current->inside_redraw = 0;
   }
 
-  world_get_single_object_bounds(toplevel, o_current,
-                                 &left, &top, &right, &bottom);
-  WORLDtoSCREEN(toplevel, left, top, &s_left, &s_top);
-  WORLDtoSCREEN(toplevel, right, bottom, &s_right, &s_bottom);
-  o_invalidate_rect (w_current, s_left,  s_bottom, s_right, s_top);
-
+  if (world_get_single_object_bounds(toplevel, o_current, &left,  &top,
+                                                          &right, &bottom)) {
+    WORLDtoSCREEN(toplevel, left, top, &s_left, &s_top);
+    WORLDtoSCREEN(toplevel, right, bottom, &s_right, &s_bottom);
+    o_invalidate_rect (w_current, s_left,  s_bottom, s_right, s_top);
+  }
 }
 
 /*! \todo Finish function documentation!!!
@@ -242,10 +244,12 @@ void o_erase_selected(GSCHEM_TOPLEVEL *w_current)
     iter = g_list_next( iter );
   }
 
-  world_get_object_glist_bounds(toplevel, list, &left, &top, &right, &bottom);
-  WORLDtoSCREEN(toplevel, left, top, &s_left, &s_top);
-  WORLDtoSCREEN(toplevel, right, bottom, &s_right, &s_bottom);
-  o_invalidate_rect (w_current, s_left,  s_bottom, s_right, s_top);
+  if (world_get_object_glist_bounds(toplevel, list, &left,  &top,
+                                                    &right, &bottom)) {
+    WORLDtoSCREEN(toplevel, left, top, &s_left, &s_top);
+    WORLDtoSCREEN(toplevel, right, bottom, &s_right, &s_bottom);
+    o_invalidate_rect (w_current, s_left,  s_bottom, s_right, s_top);
+  }
 }
 
 /*! \todo Finish function documentation!!!
@@ -275,11 +279,12 @@ void o_erase_single(GSCHEM_TOPLEVEL *w_current, OBJECT *object)
   }
   toplevel->override_color = -1;
 
-  world_get_single_object_bounds(toplevel, o_current,
-                                 &left, &top, &right, &bottom);
-  WORLDtoSCREEN(toplevel, left, top, &s_left, &s_top);
-  WORLDtoSCREEN(toplevel, right, bottom, &s_right, &s_bottom);
-  o_invalidate_rect (w_current, s_left,  s_bottom, s_right, s_top);
+  if (world_get_single_object_bounds(toplevel, o_current, &left,  &top,
+                                                          &right, &bottom)) {
+    WORLDtoSCREEN(toplevel, left, top, &s_left, &s_top);
+    WORLDtoSCREEN(toplevel, right, bottom, &s_right, &s_bottom);
+    o_invalidate_rect (w_current, s_left,  s_bottom, s_right, s_top);
+  }
 }
 
 /*! \todo Finish function documentation!!!

commit 17998a71cc46a7eff3c738fcbd3851c7c8ea5930
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Mon Dec 17 23:11:44 2007 +0000

    Fix bug #1851403: Crash after adding component while in move mode
    
    Ensure any operation already in progress when opening the component
    selector is cancelled by calling o_redraw_cleanstates() first.
    
    Also call o_redraw_cleanstates() just before placing the component,
    rather then directly freeing the objects in the complex place list.
    Since the component selector isn't modal, the user may have switched
    to a different action whilst the component selector was open.
    
    To avoid a similar crash, use o_redraw_cleanstates() upon closing the
    component selector (if we are still in component placement mode).

diff --git a/gschem/src/i_callbacks.c b/gschem/src/i_callbacks.c
index a62427c..f691eb4 100644
--- a/gschem/src/i_callbacks.c
+++ b/gschem/src/i_callbacks.c
@@ -2251,6 +2251,7 @@ DEFINE_I_CALLBACK(add_component)
 
   exit_if_null(w_current);
 
+  o_redraw_cleanstates (w_current);
   x_compselect_open (w_current);
 
   i_update_middle_button(w_current,
diff --git a/gschem/src/x_compselect.c b/gschem/src/x_compselect.c
index f0f9b10..abeae9d 100644
--- a/gschem/src/x_compselect.c
+++ b/gschem/src/x_compselect.c
@@ -122,7 +122,6 @@ x_compselect_callback_response (GtkDialog *dialog,
       case COMPSELECT_RESPONSE_PLACE: {
         CLibSymbol *symbol = NULL;
         CompselectBehavior behavior;
-        gint diff_x, diff_y;
 
         g_object_get (compselect,
                       "symbol", &symbol,
@@ -143,16 +142,8 @@ x_compselect_callback_response (GtkDialog *dialog,
               g_assert_not_reached();
         }
 
-        diff_x = w_current->last_x - w_current->start_x;
-        diff_y = w_current->last_y - w_current->start_y;
-
-        o_glist_draw_xor(w_current, diff_x, diff_y,
-                         toplevel->page_current->complex_place_list);
-
-        /* Free the complex place list and its contents */
-        s_delete_object_glist(toplevel,
-                              toplevel->page_current->complex_place_list);
-        toplevel->page_current->complex_place_list = NULL;
+        /* Cancel any action / place operation currently in progress */
+        o_redraw_cleanstates (w_current);
 
         if (symbol == NULL) {
           /* If there is no symbol selected, switch to SELECT mode */
@@ -184,17 +175,16 @@ x_compselect_callback_response (GtkDialog *dialog,
         gtk_widget_destroy (GTK_WIDGET (dialog));
         w_current->cswindow = NULL;
 
-        /* Undraw any XOR outline of the place list */
-        o_complex_rubbercomplex(w_current);
+        if (w_current->event_state == ENDCOMP ||
+            w_current->event_state == DRAWCOMP) {
 
-        /* Free the complex place list and its contents */
-        s_delete_object_glist(toplevel,
-                              toplevel->page_current->complex_place_list);
-        toplevel->page_current->complex_place_list = NULL;
+          /* Cancel the place operation currently in progress */
+          o_redraw_cleanstates (w_current);
 
-        /* return to the default state */
-        i_set_state(w_current, SELECT);
-        i_update_toolbar(w_current);
+          /* return to the default state */
+          i_set_state(w_current, SELECT);
+          i_update_toolbar(w_current);
+        }
         break;
 
       default:

commit 83b4c4f7d62c8a0a6a52ec092c9535f81f82deac
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Mon Dec 17 23:03:53 2007 +0000

    Fix memory leak in o_redraw_cleanstates() called during copy or place.
    
    For actions other than "MOVE", the objects in the complex_place_list
    must be free'd as they are otherwise unowned.

diff --git a/gschem/src/o_basic.c b/gschem/src/o_basic.c
index 4a89849..d204b9c 100644
--- a/gschem/src/o_basic.c
+++ b/gschem/src/o_basic.c
@@ -512,21 +512,19 @@ int o_redraw_cleanstates(GSCHEM_TOPLEVEL *w_current)
     case(MOVE): 
     case(NETCONT): 
     case(ZOOMBOXEND): 
-      /* reset all rubberband variables and touch the select state */
-      w_current->start_x = w_current->second_x = w_current->last_x = -1;
-      w_current->start_y = w_current->second_y = w_current->last_y = -1;
-      w_current->loc_x = w_current->loc_y = w_current->distance = -1;
-      i_set_state(w_current, SELECT);
-
-      /* from i_callback_cancel() */
-      o_redraw_all(w_current);
-      /* it is possible to cancel in the middle of a complex place
+      /* it is possible to cancel in the middle of a place,
        * so lets be sure to clean up the complex_place_list
-       * structure and also clean up the attrib_place_list.
-       * remember these don't remove the head structure */
-      /* The complex place is a reference to the real objects, so don't
-	 free the objects here */
-      g_list_free (toplevel->page_current->complex_place_list);
+       * structure and also clean up the attrib_place_list. */
+
+      /* If it is a move command, then free the complex place list WITHOUT
+         freeing the individual objects. */
+      if ((w_current->event_state == MOVE) ||
+          (w_current->event_state == ENDMOVE)) {
+        g_list_free (toplevel->page_current->complex_place_list);
+      } else {
+        s_delete_object_glist(toplevel,
+                              toplevel->page_current->complex_place_list);
+      }
       toplevel->page_current->complex_place_list = NULL;
 
       s_delete_object_glist (toplevel,
@@ -536,6 +534,15 @@ int o_redraw_cleanstates(GSCHEM_TOPLEVEL *w_current)
       /* also free internal current_attribute */
       o_attrib_free_current(toplevel);
       w_current->inside_action = 0;
+
+      /* reset all rubberband variables and touch the select state */
+      w_current->start_x = w_current->second_x = w_current->last_x = -1;
+      w_current->start_y = w_current->second_y = w_current->last_y = -1;
+      w_current->loc_x = w_current->loc_y = w_current->distance = -1;
+      i_set_state(w_current, SELECT);
+
+      /* from i_callback_cancel() */
+      o_redraw_all(w_current);
       return TRUE;
 
     /* all remaining states without dc changes */

commit 95a9632f6b4970b578fe06647496f339ee5fa1f8
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Mon Dec 17 23:03:49 2007 +0000

    Fix i_callback_edit_copy_hotkey() to set new state after clearing old.
    
    o_redraw_cleanstates() needs to know the state it's clearing up.

diff --git a/gschem/src/i_callbacks.c b/gschem/src/i_callbacks.c
index c404790..a62427c 100644
--- a/gschem/src/i_callbacks.c
+++ b/gschem/src/i_callbacks.c
@@ -607,8 +607,8 @@ DEFINE_I_CALLBACK(edit_copy_hotkey)
 
   i_update_middle_button(w_current, i_callback_edit_copy_hotkey, _("Copy"));
   if (o_select_return_first_object(w_current)) {
+    o_redraw_cleanstates(w_current);
     w_current->event_state = COPY; 
-    o_redraw_cleanstates(w_current);	
     o_copy_start(w_current, mouse_x, mouse_y);
     w_current->event_state = ENDCOPY;
     w_current->inside_action = 1;




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