Test dynamic_cast for safety from future changes
This commit is contained in:
parent
33a40e788b
commit
81ee5edcaf
|
@ -289,7 +289,8 @@ public:
|
||||||
{
|
{
|
||||||
// Commit any pending in-place edits before the row gets moved out from under
|
// Commit any pending in-place edits before the row gets moved out from under
|
||||||
// the editor.
|
// the editor.
|
||||||
dynamic_cast<WX_GRID*>( GetView() )->CommitPendingChanges( true );
|
if( auto grid = dynamic_cast<WX_GRID*>( GetView() ) )
|
||||||
|
grid->CommitPendingChanges( true );
|
||||||
|
|
||||||
wxGridTableMessage msg( this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, 0, m_rows.size() );
|
wxGridTableMessage msg( this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, 0, m_rows.size() );
|
||||||
GetView()->ProcessTableMessage( msg );
|
GetView()->ProcessTableMessage( msg );
|
||||||
|
|
|
@ -886,7 +886,10 @@ void DIALOG_FOOTPRINT_BOARD_EDITOR::OnUpdateUI( wxUpdateUIEvent& )
|
||||||
if( grid == m_itemsGrid && row == 0 && col == 0 )
|
if( grid == m_itemsGrid && row == 0 && col == 0 )
|
||||||
{
|
{
|
||||||
auto referenceEditor = grid->GetCellEditor( 0, 0 );
|
auto referenceEditor = grid->GetCellEditor( 0, 0 );
|
||||||
SelectReferenceNumber( dynamic_cast<wxTextEntry*>( referenceEditor->GetControl() ) );
|
|
||||||
|
if( auto textEntry = dynamic_cast<wxTextEntry*>( referenceEditor->GetControl() ) )
|
||||||
|
SelectReferenceNumber( textEntry );
|
||||||
|
|
||||||
referenceEditor->DecRef();
|
referenceEditor->DecRef();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue