Special handling for presence of Ref or Value in groups.
Fixes https://gitlab.com/kicad/code/kicad/issues/6677
This commit is contained in:
parent
c87a1ca17a
commit
5e9d9f5753
|
@ -94,13 +94,16 @@ FOOTPRINT::FOOTPRINT( const FOOTPRINT& aFootprint ) :
|
|||
m_thermalWidth = aFootprint.m_thermalWidth;
|
||||
m_thermalGap = aFootprint.m_thermalGap;
|
||||
|
||||
std::map<BOARD_ITEM*, BOARD_ITEM*> ptrMap;
|
||||
|
||||
// Copy reference and value.
|
||||
m_reference = new FP_TEXT( *aFootprint.m_reference );
|
||||
m_reference->SetParent( this );
|
||||
ptrMap[ aFootprint.m_reference ] = m_reference;
|
||||
|
||||
m_value = new FP_TEXT( *aFootprint.m_value );
|
||||
m_value->SetParent( this );
|
||||
|
||||
std::map<BOARD_ITEM*, BOARD_ITEM*> ptrMap;
|
||||
ptrMap[ aFootprint.m_value ] = m_value;
|
||||
|
||||
// Copy pads
|
||||
for( PAD* pad : aFootprint.Pads() )
|
||||
|
|
|
@ -1396,6 +1396,14 @@ int EDIT_TOOL::Remove( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
if( bItem->GetParent() && bItem->GetParent()->Type() == PCB_FOOTPRINT_T )
|
||||
{
|
||||
// Silently ignore delete of Reference or Value if they happen to be in
|
||||
// group.
|
||||
if( bItem->Type() == PCB_FP_TEXT_T )
|
||||
{
|
||||
if( static_cast<FP_TEXT*>( bItem )->GetType() != FP_TEXT::TEXT_is_DIVERS )
|
||||
return;
|
||||
}
|
||||
|
||||
m_commit->Modify( bItem->GetParent() );
|
||||
getView()->Remove( bItem );
|
||||
bItem->GetParent()->Remove( bItem );
|
||||
|
|
Loading…
Reference in New Issue