Coverity tweaks.

This commit is contained in:
Jeff Young 2025-07-27 13:16:03 +01:00
parent 755537ad8c
commit 8a1669dc53
2 changed files with 12 additions and 21 deletions

View File

@ -204,31 +204,22 @@ void PANEL_TEXT_VARIABLES::OnGridCellChanging( wxGridEvent& event )
void PANEL_TEXT_VARIABLES::OnAddTextVar( wxCommandEvent& event )
{
if( !m_TextVars->CommitPendingChanges() )
return;
AppendTextVar( wxEmptyString, wxEmptyString );
m_TextVars->MakeCellVisible( m_TextVars->GetNumberRows() - 1, TV_NAME_COL );
m_TextVars->SetGridCursor( m_TextVars->GetNumberRows() - 1, TV_NAME_COL );
m_TextVars->EnableCellEditControl( true );
m_TextVars->ShowCellEditControl();
m_TextVars->OnAddRow(
[&]() -> std::pair<int, int>
{
AppendTextVar( wxEmptyString, wxEmptyString );
return { m_TextVars->GetNumberRows() - 1, TV_NAME_COL };
} );
}
void PANEL_TEXT_VARIABLES::OnRemoveTextVar( wxCommandEvent& event )
{
int curRow = m_TextVars->GetGridCursorRow();
if( curRow < 0 || m_TextVars->GetNumberRows() <= curRow )
return;
m_TextVars->CommitPendingChanges( true /* silent mode; we don't care if it's valid */ );
m_TextVars->DeleteRows( curRow, 1 );
m_TextVars->MakeCellVisible( std::max( 0, curRow-1 ), m_TextVars->GetGridCursorCol() );
m_TextVars->SetGridCursor( std::max( 0, curRow-1 ), m_TextVars->GetGridCursorCol() );
m_TextVars->OnDeleteRows(
[&]( int row )
{
m_TextVars->DeleteRows( row, 1 );
} );
}

View File

@ -152,7 +152,7 @@ void IPC356D_WRITER::build_pad_testpoints( BOARD *aPcb, std::vector <D356_RECORD
if( pad->GetLayerSet()[B_Mask] )
rk.soldermask &= ~2;
aRecords.push_back( rk );
aRecords.push_back( std::move( rk ) );
}
}
}