Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 13490) +++ trunk/src/buffer.c (revision 13491) @@ -112,6 +112,7 @@ if (pcb != NULL) pcb_data_bind_board_layers(pcb, Buffer->Data, 0); } + Buffer->from_outside = 0; } /* add or move selected */ @@ -143,6 +144,7 @@ Buffer->X = pcb_crosshair.X; Buffer->Y = pcb_crosshair.Y; } + Buffer->from_outside = 0; pcb_notify_crosshair_change(pcb_true); } @@ -239,6 +241,7 @@ pcb_data_make_layers_bound(newPCB, Buffer->Data); pcb_data_binding_update(pcb, Buffer->Data); pcb_board_remove(newPCB); + Buffer->from_outside = 1; pcb_event(PCB_EVENT_LAYERS_CHANGED, NULL); /* undo the events generated on load */ return (pcb_true); } @@ -248,6 +251,7 @@ if (Buffer->Data != NULL) PCB_CLEAR_PARENT(Buffer->Data); pcb_event(PCB_EVENT_LAYERS_CHANGED, NULL); /* undo the events generated on load */ + Buffer->from_outside = 0; return (pcb_false); } @@ -585,6 +589,7 @@ ctx.copy.pcb = pcb; ctx.copy.DeltaX = X - PCB_PASTEBUFFER->X; ctx.copy.DeltaY = Y - PCB_PASTEBUFFER->Y; + ctx.copy.from_outside = PCB_PASTEBUFFER->from_outside; /* paste all layers */ num_layers = PCB_PASTEBUFFER->Data->LayerN; Index: trunk/src/buffer.h =================================================================== --- trunk/src/buffer.h (revision 13490) +++ trunk/src/buffer.h (revision 13491) @@ -35,6 +35,7 @@ pcb_coord_t X, Y; /* offset */ pcb_box_t BoundingBox; pcb_data_t *Data; /* data; not all members of pcb_board_t */ + int from_outside; /* data is coming from outside of the current board (lib, loaded board) */ /* are used */ }; Index: trunk/src/copy.c =================================================================== --- trunk/src/copy.c (revision 13490) +++ trunk/src/copy.c (revision 13491) @@ -66,6 +66,7 @@ ctx.copy.pcb = PCB; ctx.copy.DeltaX = DX; ctx.copy.DeltaY = DY; + ctx.copy.from_outside = 0; /* the subroutines add the objects to the undo-list */ ptr = pcb_object_operation(&CopyFunctions, &ctx, Type, Ptr1, Ptr2, Ptr3); Index: trunk/src/obj_elem.c =================================================================== --- trunk/src/obj_elem.c (revision 13490) +++ trunk/src/obj_elem.c (revision 13491) @@ -146,6 +146,7 @@ Buffer->X = 0; Buffer->Y = 0; + Buffer->from_outside = 1; if (elementlist_length(&Buffer->Data->Element)) { pcb_element_t *element = elementlist_first(&Buffer->Data->Element); Index: trunk/src/obj_subc.c =================================================================== --- trunk/src/obj_subc.c (revision 13490) +++ trunk/src/obj_subc.c (revision 13491) @@ -895,8 +895,7 @@ pcb_undo_add_obj_to_create(PCB_TYPE_SUBC, sc, sc, sc); -#warning subc TODO: BUG: "move selected" is really a copy&paste and this will send the subc to the top side - if (conf_core.editor.show_solder_side) { + if (ctx->copy.from_outside && conf_core.editor.show_solder_side) { uundo_serial_t last; /* move-to-the-other-side is not undoable: it's part of the placement */ Index: trunk/src/operation.h =================================================================== --- trunk/src/operation.h (revision 13490) +++ trunk/src/operation.h (revision 13491) @@ -68,6 +68,7 @@ typedef struct { pcb_board_t *pcb; pcb_coord_t DeltaX, DeltaY; /* movement vector */ + int from_outside; } pcb_opctx_copy_t; typedef struct {