Index: trunk/src/layer.c =================================================================== --- trunk/src/layer.c (revision 29660) +++ trunk/src/layer.c (revision 29661) @@ -674,6 +674,9 @@ pcb_layergrp_notify_chg(pcb); pcb_layervis_change_group_vis(&pcb->hidlib, new_lid, 1, 1); pcb_event(&pcb->hidlib, PCB_EVENT_LAYERVIS_CHANGED, NULL); + + pcb_message(PCB_MSG_WARNING, "this operation is not undoable.\n"); +/* pcb_undo_inc_serial();*/ } static void pcb_layer_move_delete(pcb_board_t *pcb, pcb_layer_id_t old_index, pcb_layergrp_id_t new_in_grp) @@ -724,6 +727,8 @@ pcb_layer_stack[l]--; pcb_layergrp_notify_chg(pcb); + pcb_message(PCB_MSG_WARNING, "this operation is not undoable.\n"); +/* pcb_undo_inc_serial();*/ } @@ -765,15 +770,9 @@ The new layer design presents the layers by groups to preserve physical order. In this system the index of the logical layer on the logical layer list is insignificant, thus we shouldn't try to change it. */ + return 1; } - if (at >= 0) { - pcb_undo_add_layer_move(old_index, new_index, at); - pcb_undo_inc_serial(); - } - else - pcb_message(PCB_MSG_WARNING, "this operation is not undoable.\n"); - return 0; } Index: trunk/src/undo_old.c =================================================================== --- trunk/src/undo_old.c (revision 29660) +++ trunk/src/undo_old.c (revision 29661) @@ -769,37 +769,6 @@ return UndoSwapCopiedObject(Entry); } -/* --------------------------------------------------------------------------- - * undo a layer change - * returns pcb_true on success - */ -static pcb_bool UndoLayerMove(UndoListTypePtr Entry) -{ - LayerChangeTypePtr l = &Entry->Data.LayerChange; - int tmp; - - if (l->old_index == -1) { /* was creating new */ - l->old_index = l->at; - l->at = l->new_index; - l->new_index = -1; - } - else if (l->new_index == -1) { /* was deleting existing */ - l->new_index = l->at; - l->at = l->old_index; - l->old_index = -1; - } - else { - tmp = l->new_index; - l->new_index = l->old_index; - l->old_index = tmp; - } - - if (pcb_layer_move(PCB, l->old_index, l->new_index, -1)) - return pcb_false; - else - return pcb_true; -} - static int pcb_undo_old_undo(void *ptr_) { UndoListTypePtr ptr = ptr_; @@ -899,11 +868,6 @@ return 0; break; - case PCB_UNDO_LAYERMOVE: - if (UndoLayerMove(ptr)) - return 0; - break; - case PCB_UNDO_OTHERSIDE: if (UndoOtherSide(ptr)) return 0; @@ -1278,21 +1242,6 @@ } } -/* --------------------------------------------------------------------------- - * adds a layer change (new, delete, move) to the undo list. - */ -void pcb_undo_add_layer_move(int old_index, int new_index, int at) -{ - UndoListTypePtr undo; - - if (!Locked) { - undo = GetUndoSlot(PCB_UNDO_LAYERMOVE, 0, 0); - undo->Data.LayerChange.old_index = old_index; - undo->Data.LayerChange.new_index = new_index; - undo->Data.LayerChange.at = at; - } -} - #ifndef NDEBUG const char *undo_type2str(int type) { @@ -1316,7 +1265,6 @@ case PCB_UNDO_CHANGECLEARSIZE: return "chngeclearsize"; case PCB_UNDO_CHANGEANGLES: return "changeangles"; case PCB_UNDO_CHANGERADII: return "changeradii"; - case PCB_UNDO_LAYERMOVE: return "layermove"; case PCB_UNDO_CLEAR: return "clear"; } sprintf(buff, "Unknown %d", type); Index: trunk/src/undo_old.h =================================================================== --- trunk/src/undo_old.h (revision 29660) +++ trunk/src/undo_old.h (revision 29661) @@ -54,7 +54,6 @@ void pcb_undo_add_obj_to_change_angles(int, void *, void *, void *); void pcb_undo_add_obj_to_change_radii(int, void *, void *, void *); void pcb_undo_add_obj_to_clear_poly(int, void *, void *, void *, pcb_bool); -void pcb_undo_add_layer_move(int, int, int); /* --------------------------------------------------------------------------- * define supported types of undo operations @@ -75,7 +74,6 @@ PCB_UNDO_CHANGESIZE = 0x000800, /* change size of object */ PCB_UNDO_CHANGECLEARSIZE = 0x004000, /* change clearance size */ PCB_UNDO_CHANGEANGLES = 0x010000, /* change arc angles */ - PCB_UNDO_LAYERMOVE = 0x020000, /* layer new/delete/move */ PCB_UNDO_CLEAR = 0x040000, /* clear/restore to polygons */ PCB_UNDO_CHANGERADII = 0x200000, /* change arc radii */ PCB_UNDO_OTHERSIDE = 0x400000, /* change side of board (subcircuit) */ Index: trunk/src/undo_old_str.h =================================================================== --- trunk/src/undo_old_str.h (revision 29660) +++ trunk/src/undo_old_str.h (revision 29661) @@ -29,12 +29,6 @@ pcb_cardinal_t OriginalLayer; /* the index of the original layer */ } MoveToLayer; -typedef struct { /* information about layer changes */ - int old_index; - int new_index; - int at; -} LayerChangeType, *LayerChangeTypePtr; - typedef struct { /* information about poly clear/restore */ pcb_bool Clear; /* pcb_true was clear, pcb_false was restore */ pcb_layer_t *Layer; @@ -63,7 +57,6 @@ MoveToLayer MoveToLayer; pcb_flag_t Flags; pcb_coord_t Size; - LayerChangeType LayerChange; ClearPolyType ClearPoly; NetlistChangeType NetlistChange; long int CopyID;