Pcbnew: prevent delete hot key from deleting locked footprints. (fixes lp:1538805)

This commit is contained in:
Wayne Stambaugh 2016-02-29 16:12:03 -05:00
parent 4d2a05856f
commit bd800630be
1 changed files with 7 additions and 4 deletions

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009 Jean-Pierre Charras, jp.charras@wanadoo.fr
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -647,7 +647,7 @@ bool PCB_EDIT_FRAME::OnHotkeyDeleteItem( wxDC* aDC )
wxPoint pos = RefPos( false );
MODULE* module = GetBoard()->GetFootprint( pos, UNDEFINED_LAYER, false );
if( module == NULL )
if( module == NULL || module->IsLocked() )
return false;
RemoveStruct( module, aDC );
@ -661,13 +661,14 @@ bool PCB_EDIT_FRAME::OnHotkeyDeleteItem( wxDC* aDC )
{
item = PcbGeneralLocateAndDisplay();
if( item == NULL )
// Shouldn't there be a check for locked tracks and vias here?
if( item == NULL || (item->Type() == PCB_MODULE_T && (MODULE*)item->IsLocked()) )
return false;
RemoveStruct( item, aDC );
}
else
return false;
return false;
}
OnModify();
@ -920,6 +921,7 @@ bool PCB_EDIT_FRAME::OnHotkeyMoveItem( int aIdCommand )
return false;
}
bool PCB_EDIT_FRAME::OnHotkeyPlaceItem( wxDC* aDC )
{
BOARD_ITEM* item = GetCurItem();
@ -1133,6 +1135,7 @@ bool PCB_EDIT_FRAME::OnHotkeyRotateItem( int aIdCommand )
return false;
}
bool PCB_EDIT_FRAME::OnHotkeyDuplicateOrArrayItem( int aIdCommand )
{
BOARD_ITEM* item = GetCurItem();