← Back to team overview

kicad-developers team mailing list archive

[PATCH] Locked modules locked in block operations



I have previously submitted a couple of patches that prevented direct
manipulation of locked modules in pcbnew. However, within a block it
remained possible to, e.g., move a locked module. This patch prevents locked
modules from being added to the list of selected items in a block operation.
The downside of doing this in the Block_SelectItems function is that it also
prevents the block copy of locked items, if for some reason someone happens
to need that.


=== modified file 'pcbnew/block.cpp'
--- pcbnew/block.cpp	2010-08-19 14:21:05 +0000
+++ pcbnew/block.cpp	2010-10-16 20:38:19 +0000
@@ -414,7 +414,8 @@
         for( MODULE* module = m_Pcb->m_Modules; module != NULL;
              module = module->Next() )
-            if( module->HitTest( GetScreen()->m_BlockLocate ) )
+            if( module->HitTest( GetScreen()->m_BlockLocate ) &&
+                !module->IsLocked() )
                 picker.m_PickedItem     = module;
                 picker.m_PickedItemType = module->Type();

Follow ups