mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-13 17:53:11 +02:00
Use WX_GRID::ClearRows() to avoid assertions.
Fixes KICAD-VM1.
This commit is contained in:
parent
22288e02a2
commit
0b102fc085
@ -167,9 +167,7 @@ void PANEL_EMBEDDED_FILES::resizeGrid()
|
||||
bool PANEL_EMBEDDED_FILES::TransferDataToWindow()
|
||||
{
|
||||
m_files_grid->ClearGrid();
|
||||
|
||||
if( m_files_grid->GetNumberRows() > 0 )
|
||||
m_files_grid->DeleteRows( 0, m_files_grid->GetNumberRows() );
|
||||
m_files_grid->ClearRows();
|
||||
|
||||
int ii = 0;
|
||||
|
||||
|
@ -244,10 +244,10 @@ public:
|
||||
* to the number of rows (even if the delete count is 0). Needless to say, this makes using
|
||||
* DeleteRows for clearing a lot more cumbersome so we add a helper here.
|
||||
*/
|
||||
void ClearRows()
|
||||
void ClearRows( bool aUpdateLabels = true )
|
||||
{
|
||||
if( GetNumberRows() )
|
||||
DeleteRows( 0, GetNumberRows() );
|
||||
if( GetNumberRows() > 0 )
|
||||
DeleteRows( 0, GetNumberRows(), aUpdateLabels );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -518,9 +518,7 @@ void PANEL_JOBSET::RemoveDestination( PANEL_DESTINATION* aPanel )
|
||||
|
||||
void PANEL_JOBSET::rebuildJobList()
|
||||
{
|
||||
if( m_jobsGrid->GetNumberRows() )
|
||||
m_jobsGrid->DeleteRows( 0, m_jobsGrid->GetNumberRows() );
|
||||
|
||||
m_jobsGrid->ClearRows();
|
||||
m_jobsGrid->AppendRows( (int) m_jobsFile->GetJobs().size() );
|
||||
|
||||
int num = 1;
|
||||
|
@ -206,8 +206,7 @@ void DIALOG_MANAGE_REPOSITORIES::selectRow( int aRow )
|
||||
void DIALOG_MANAGE_REPOSITORIES::SetData( const std::vector<std::pair<wxString, wxString>>& aData )
|
||||
{
|
||||
m_grid->Freeze();
|
||||
|
||||
m_grid->DeleteRows( 0, m_grid->GetNumberRows() );
|
||||
m_grid->ClearRows();
|
||||
m_grid->AppendRows( aData.size() );
|
||||
|
||||
for( size_t i = 0; i < aData.size(); i++ )
|
||||
|
@ -302,9 +302,7 @@ void PANEL_PACKAGES_VIEW::setPackageDetails( const PACKAGE_VIEW_DATA& aPackageDa
|
||||
|
||||
// Versions table
|
||||
m_gridVersions->Freeze();
|
||||
|
||||
if( m_gridVersions->GetNumberRows() != 0 )
|
||||
m_gridVersions->DeleteRows( 0, m_gridVersions->GetNumberRows() );
|
||||
m_gridVersions->ClearRows();
|
||||
|
||||
int row = 0;
|
||||
wxString current_version;
|
||||
@ -395,10 +393,7 @@ void PANEL_PACKAGES_VIEW::unsetPackageDetails()
|
||||
|
||||
// Clean up grid just so we don't keep stale info around (it's already been hidden).
|
||||
m_gridVersions->Freeze();
|
||||
|
||||
if( m_gridVersions->GetNumberRows() > 0 )
|
||||
m_gridVersions->DeleteRows( 0, m_gridVersions->GetNumberRows() );
|
||||
|
||||
m_gridVersions->ClearRows();
|
||||
m_gridVersions->Thaw();
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,7 @@ void PANEL_SETUP_TRACKS_AND_VIAS::OnSortTrackWidthsClick( wxCommandEvent& aEvent
|
||||
}
|
||||
|
||||
std::sort( trackWidths.begin(), trackWidths.end() );
|
||||
m_trackWidthsGrid->DeleteRows( 0, m_trackWidthsGrid->GetNumberRows(), false );
|
||||
m_trackWidthsGrid->ClearRows( false );
|
||||
|
||||
for( int width : trackWidths )
|
||||
AppendTrackWidth( width );
|
||||
@ -194,7 +194,7 @@ void PANEL_SETUP_TRACKS_AND_VIAS::OnSortViaSizesClick( wxCommandEvent& aEvent )
|
||||
}
|
||||
|
||||
std::sort( vias.begin(), vias.end() );
|
||||
m_viaSizesGrid->DeleteRows( 0, m_viaSizesGrid->GetNumberRows(), false );
|
||||
m_viaSizesGrid->ClearRows( false );
|
||||
|
||||
for( const VIA_DIMENSION& via : vias )
|
||||
AppendViaSize( via.m_Diameter, via.m_Drill );
|
||||
@ -236,7 +236,7 @@ void PANEL_SETUP_TRACKS_AND_VIAS::OnSortDiffPairsClick( wxCommandEvent& aEvent )
|
||||
}
|
||||
|
||||
std::sort( diffPairs.begin(), diffPairs.end() );
|
||||
m_diffPairsGrid->DeleteRows( 0, m_diffPairsGrid->GetNumberRows(), false );
|
||||
m_diffPairsGrid->ClearRows( false );
|
||||
|
||||
for( const DIFF_PAIR_DIMENSION& dp : diffPairs )
|
||||
AppendDiffPairs( dp.m_Width, dp.m_Gap, dp.m_ViaGap );
|
||||
|
Loading…
x
Reference in New Issue
Block a user