Commit aafdfd01 authored by Maciej Suminski's avatar Maciej Suminski
Browse files

Disabled 'Duplicate' & 'Create array' for pads in the layout editor.

parent 9bed4814
Loading
Loading
Loading
Loading
+16 −4
Original line number Diff line number Diff line
@@ -1531,11 +1531,16 @@ void PCB_EDIT_FRAME::moveExact()
void PCB_EDIT_FRAME::duplicateItem( bool aIncrement )
{
    BOARD_ITEM* item = GetScreen()->GetCurItem();

    bool editingModule = NULL != dynamic_cast<FOOTPRINT_EDIT_FRAME*>( this );
    int move_cmd = 0;

    BOARD_ITEM* new_item = GetBoard()->DuplicateAndAddItem(
            item, aIncrement );
    if( item->Type() == PCB_PAD_T && !editingModule )
    {
        // If it is not the module editor, then duplicate the parent module instead
        item = static_cast<MODULE*>( item )->GetParent();
    }

    BOARD_ITEM* new_item = GetBoard()->DuplicateAndAddItem( item, aIncrement );

    SaveCopyInUndoList( new_item, UR_NEW );

@@ -1595,6 +1600,7 @@ void PCB_BASE_EDIT_FRAME::createArray()
    bool editingModule = NULL != dynamic_cast<FOOTPRINT_EDIT_FRAME*>( this );

    BOARD* board = GetBoard();
    // Remember it is valid only in the module editor
    MODULE* module = static_cast<MODULE*>( item->GetParent() );

    DIALOG_CREATE_ARRAY::ARRAY_OPTIONS* array_opts = NULL;
@@ -1608,6 +1614,12 @@ void PCB_BASE_EDIT_FRAME::createArray()
    {
        PICKED_ITEMS_LIST newItemsList;

        if( item->Type() == PCB_PAD_T && !editingModule )
        {
            // If it is not the module editor, then duplicate the parent module instead
            item = static_cast<MODULE*>( item )->GetParent();
        }

        if( editingModule )
        {
            // modedit saves everything upfront
+2 −2

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.