Pcbnew: fix crash when trying to delete a PCB_TEXT.
This commit is contained in:
parent
31354a2d91
commit
054de5687c
|
@ -1798,15 +1798,25 @@ void EDIT_TOOL::DeleteItems( const PCB_SELECTION& aItems, bool aIsCut )
|
||||||
{
|
{
|
||||||
case PCB_TEXT::TEXT_is_VALUE:
|
case PCB_TEXT::TEXT_is_VALUE:
|
||||||
case PCB_TEXT::TEXT_is_REFERENCE:
|
case PCB_TEXT::TEXT_is_REFERENCE:
|
||||||
|
wxASSERT( parentFP );
|
||||||
m_commit->Modify( parentFP );
|
m_commit->Modify( parentFP );
|
||||||
static_cast<PCB_TEXT*>( board_item )->SetVisible( false );
|
static_cast<PCB_TEXT*>( board_item )->SetVisible( false );
|
||||||
getView()->Update( board_item );
|
getView()->Update( board_item );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PCB_TEXT::TEXT_is_DIVERS:
|
case PCB_TEXT::TEXT_is_DIVERS:
|
||||||
m_commit->Modify( parentFP );
|
if( IsFootprintEditor() )
|
||||||
getView()->Remove( board_item );
|
{
|
||||||
parentFP->Remove( board_item );
|
m_commit->Modify( parentFP );
|
||||||
|
getView()->Remove( board_item );
|
||||||
|
parentFP->Remove( board_item );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_commit->Remove( board_item );
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
wxFAIL; // Shouldn't get here
|
wxFAIL; // Shouldn't get here
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue