From a3e087ab518fd914c41116b2fb5fe70b4bfccaf9 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 18 Apr 2020 20:00:26 +0200 Subject: [PATCH] Pcbnew: Fix crashes when delete footprint text in some cases. Fixes #4221 https://gitlab.com/kicad/code/kicad/issues/4221 --- pcbnew/dialogs/dialog_exchange_footprints.cpp | 2 +- .../dialog_exchange_footprints_base.fbp | 1786 ++++++++--------- 2 files changed, 894 insertions(+), 894 deletions(-) diff --git a/pcbnew/dialogs/dialog_exchange_footprints.cpp b/pcbnew/dialogs/dialog_exchange_footprints.cpp index 53802f064d..47a77bdcc9 100644 --- a/pcbnew/dialogs/dialog_exchange_footprints.cpp +++ b/pcbnew/dialogs/dialog_exchange_footprints.cpp @@ -468,7 +468,7 @@ void PCB_EDIT_FRAME::Exchange_Module( MODULE* aSrc, MODULE* aDest, BOARD_COMMIT& if( destItem ) processTextItem( *srcItem, *destItem, false, resetTextLayers, resetTextEffects ); else if( !deleteExtraTexts ) - aDest->GraphicalItemsList().Append( new TEXTE_MODULE( *srcItem ) ); + aDest->Add( new TEXTE_MODULE( *srcItem ) ); } } diff --git a/pcbnew/dialogs/dialog_exchange_footprints_base.fbp b/pcbnew/dialogs/dialog_exchange_footprints_base.fbp index ab87070498..45c1171e15 100644 --- a/pcbnew/dialogs/dialog_exchange_footprints_base.fbp +++ b/pcbnew/dialogs/dialog_exchange_footprints_base.fbp @@ -1,8 +1,8 @@ - + - + C++ 1 source_name @@ -16,9 +16,9 @@ none 1 dialog_exchange_footprints_base - + . - + 1 1 1 @@ -29,67 +29,67 @@ 0 wxAUI_MGR_DEFAULT - - - + + + 1 1 impl_virtual - - - + + + 0 wxID_ANY - - + + DIALOG_EXCHANGE_FOOTPRINTS_BASE - + -1,-1 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h %s - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + updateMatchModeRadioButtons - + m_mainSizer wxVERTICAL protected @@ -98,12 +98,12 @@ wxEXPAND|wxTOP|wxRIGHT|wxLEFT 0 - + wxBOTH 1 - + 0 - + m_upperSizer wxFLEX_GROWMODE_SPECIFIED protected @@ -120,83 +120,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY %s all footprints on board - + 0 - - + + 0 -1,-1 1 m_matchAll 1 - - + + protected 1 - + Resizable 1 - - + + ; 0 - - + + wxFILTER_NONE wxDefaultValidator - + 0 - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + OnMatchAllClicked - - - - - - + + + + + + @@ -211,83 +211,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY %s selected footprint - + 0 - - + + 0 - + 1 m_matchSelected 1 - - + + protected 1 - + Resizable 1 - - + + ; forward_declare 0 - - + + wxFILTER_NONE wxDefaultValidator - + 0 - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + OnMatchSelectedClicked - - - - - - + + + + + + @@ -302,83 +302,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY %s footprints matching reference: - + 0 - - + + 0 -1,-1 1 m_matchSpecifiedRef 1 - - + + protected 1 - + Resizable 1 - - + + ; 0 - - + + wxFILTER_NONE wxDefaultValidator - + 0 - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + OnMatchRefClicked - - - - - - + + + + + + @@ -393,86 +393,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 -1,-1 - - + + 0 200,-1 1 m_specifiedRef 1 - - + + protected 1 - + Resizable 1 - + wxTE_PROCESS_ENTER ; 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + OnMatchRefClicked OnMatchRefClicked - - - + + + @@ -487,83 +487,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY %s footprints matching value: - + 0 - - + + 0 -1,-1 1 m_matchSpecifiedValue 1 - - + + protected 1 - + Resizable 1 - - + + ; 0 - - + + wxFILTER_NONE wxDefaultValidator - + 0 - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + OnMatchValueClicked - - - - - - + + + + + + @@ -578,86 +578,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - - + + + 0 -1,-1 1 m_specifiedValue 1 - - + + protected 1 - + Resizable 1 - + wxTE_PROCESS_ENTER ; 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + OnMatchValueClicked OnMatchValueClicked - - - + + + @@ -672,83 +672,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY %s footprints with identifier: - + 0 - - + + 0 -1,-1 1 m_matchSpecifiedID 1 - - + + protected 1 - + Resizable 1 - - + + ; 0 - - + + wxFILTER_NONE wxDefaultValidator - + 0 - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + OnMatchIDClicked - - - - - - + + + + + + @@ -758,7 +758,7 @@ wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 0 - + bSizer4 wxHORIZONTAL none @@ -771,86 +771,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - - + + + 0 500,-1 1 m_specifiedID 1 - - + + protected 1 - + Resizable 1 - + wxTE_PROCESS_ENTER ; 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + OnMatchIDClicked OnMatchIDClicked - - - + + + @@ -862,88 +862,88 @@ 1 1 1 - - - - - - - - + + + + + + + + 1 0 1 - + 1 0 0 - + Dock 0 Left 1 - + 1 - - + + 0 0 - + wxID_ANY Browse Library - + 0 - - + + 0 30,29 1 m_specifiedIDBrowseButton 1 - - + + protected 1 - + Resizable - + 1 - - wxBU_AUTODRAW + + ; forward_declare 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - + + + + ViewAndSelectFootprint - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -953,7 +953,7 @@ wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 0 - + m_changeSizer wxVERTICAL protected @@ -966,76 +966,76 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - + + 0 - + 1 staticline1 1 - - + + none 1 - + Resizable 1 - + wxLI_HORIZONTAL - + 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1047,78 +1047,78 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY New footprint identifier: - + 0 - - + + 0 - + 1 newIdLabel 1 - - + + none 1 - + Resizable 1 - - + + ; 0 - - - - + + + + -1 - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1126,7 +1126,7 @@ wxEXPAND|wxLEFT 1 - + bSizer3 wxHORIZONTAL none @@ -1139,86 +1139,86 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - - + + + 0 500,-1 1 m_newID 1 - - + + protected 1 - + Resizable 1 - - + + ; 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1230,88 +1230,88 @@ 1 1 1 - - - - - - - - + + + + + + + + 1 0 1 - + 1 0 0 - + Dock 0 Left 1 - + 1 - - + + 0 0 - + wxID_ANY MyButton - + 0 - - + + 0 30,29 1 m_newIDBrowseButton 1 - - + + protected 1 - + Resizable - + 1 - - wxBU_AUTODRAW + + ; forward_declare 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - + + + + ViewAndSelectFootprint - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1325,12 +1325,12 @@ wxID_ANY Update Options - + m_updateOptionsSizer wxVERTICAL 1 protected - + 5 wxBOTTOM|wxRIGHT @@ -1340,83 +1340,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Remove text items which are not in library footprint - + 0 - - + + 0 - + 1 m_removeExtraBox 1 - - + + protected 1 - + Resizable 1 - - - + + + 0 Removes fields that do not occur in the original library symbols - + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1428,83 +1428,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Reset text layers and visibilities - + 0 - - + + 0 - + 1 m_resetTextItemLayers 1 - - + + protected 1 - + Resizable 1 - - + + ; forward_declare 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1516,83 +1516,83 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY Reset text sizes, styles and positions - + 0 - - + + 0 - + 1 m_resetTextItemEffects 1 - - + + protected 1 - + Resizable 1 - - + + ; forward_declare 0 - - + + wxFILTER_NONE wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1606,75 +1606,75 @@ 1 1 1 - - - - - - - + + + + + + + 1 0 1 - + 1 0 Dock 0 Left 1 - + 1 - + 0 0 wxID_ANY - + 0 - - + + 0 -1,240 1 m_MessageWindow 1 - - + + protected 1 - + Resizable 1 - + WX_HTML_REPORT_PANEL; wx_html_report_panel.h 0 - - - + + + wxTAB_TRAVERSAL - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -1690,17 +1690,17 @@ 0 0 0 - + m_sdbSizer protected OnApplyClicked - - - - - - - + + + + + + +