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

gEDA-cvs: gaf.git: branch: master updated (1.5.1-20081221-199-g81b2df2)



The branch, master has been updated
       via  81b2df2f166fde454c2f93d193e11cd69453d308 (commit)
      from  0ff9e9ac91823074f6240e1e762a1cca84b49d05 (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_buffer.c |   42 +++++++++++++++++-------------------------
 1 files changed, 17 insertions(+), 25 deletions(-)


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

commit 81b2df2f166fde454c2f93d193e11cd69453d308
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Date:   Sat Jan 24 00:12:52 2009 +0000

    gschem: Remove redundant buffer cut code.
    
    Part of the buffer cut/copy code can be factored out into a separate
    function to reduce code duplication. Also use g_warning for warnings.

:100644 100644 cf82276... 6cbcc1e... M	gschem/src/o_buffer.c

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

commit 81b2df2f166fde454c2f93d193e11cd69453d308
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Date:   Sat Jan 24 00:12:52 2009 +0000

    gschem: Remove redundant buffer cut code.
    
    Part of the buffer cut/copy code can be factored out into a separate
    function to reduce code duplication. Also use g_warning for warnings.

diff --git a/gschem/src/o_buffer.c b/gschem/src/o_buffer.c
index cf82276..6cbcc1e 100644
--- a/gschem/src/o_buffer.c
+++ b/gschem/src/o_buffer.c
@@ -26,21 +26,12 @@
 #include <dmalloc.h>
 #endif
 
-/*! \todo Finish function documentation!!!
- *  \brief
- *  \par Function Description
- *
- */
-void o_buffer_copy(GSCHEM_TOPLEVEL *w_current, int buf_num)
+static void
+selection_to_buffer(GSCHEM_TOPLEVEL *w_current, int buf_num)
 {
   TOPLEVEL *toplevel = w_current->toplevel;
   GList *s_current = NULL;
 
-  if (buf_num < 0 || buf_num > MAX_BUFFERS) {
-    fprintf(stderr, _("Got an invalid buffer_number [o_buffer_copy]\n"));
-    return;
-  }
-
   s_current = geda_list_get_glist( toplevel->page_current->selection_list );
 
   if (object_buffer[buf_num] != NULL) {
@@ -60,28 +51,29 @@ void o_buffer_copy(GSCHEM_TOPLEVEL *w_current, int buf_num)
  *  \par Function Description
  *
  */
-void o_buffer_cut(GSCHEM_TOPLEVEL *w_current, int buf_num)
+void o_buffer_copy(GSCHEM_TOPLEVEL *w_current, int buf_num)
 {
-  TOPLEVEL *toplevel = w_current->toplevel;
-  GList *s_current = NULL;
-
   if (buf_num < 0 || buf_num > MAX_BUFFERS) {
-    fprintf(stderr, _("Got an invalid buffer_number [o_buffer_cut]\n"));
+    g_warning (_("o_buffer_copy: Invalid buffer %i\n"), buf_num);
     return;
   }
 
-  s_current = geda_list_get_glist( toplevel->page_current->selection_list );
+  selection_to_buffer (w_current, buf_num);
+}
 
-  if (object_buffer[buf_num] != NULL) {
-    s_delete_object_glist(toplevel, object_buffer[buf_num]);
-    object_buffer[buf_num] = NULL;
+/*! \todo Finish function documentation!!!
+ *  \brief
+ *  \par Function Description
+ *
+ */
+void o_buffer_cut(GSCHEM_TOPLEVEL *w_current, int buf_num)
+{
+  if (buf_num < 0 || buf_num > MAX_BUFFERS) {
+    g_warning (_("o_buffer_cut: Invalid buffer %i\n"), buf_num);
+    return;
   }
 
-  toplevel->ADDING_SEL = 1;
-  object_buffer[buf_num] = o_glist_copy_all (toplevel, s_current,
-                                             object_buffer[buf_num],
-                                             SELECTION_FLAG);
-  toplevel->ADDING_SEL = 0;
+  selection_to_buffer (w_current, buf_num);
   o_delete_selected(w_current);
 }
 




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