Fix crash in Pcbnew and Gerbview when seceting (in layers manager) "always hide all layers but activer"

This commit is contained in:
jean-pierre charras
2014-07-20 19:41:12 +02:00
parent 2196ed21c9
commit 680ca22279
3 changed files with 6 additions and 5 deletions
+3 -3
View File
@@ -167,7 +167,7 @@ void PCB_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event )
rowCount = GetLayerRowCount();
for( int row = rowCount-1; row>=0; --row )
{
wxCheckBox* cb = (wxCheckBox*) getLayerComp( row, 3 );
wxCheckBox* cb = (wxCheckBox*) getLayerComp( row, COLUMN_COLOR_LYR_CB );
LAYER_ID layer = ToLAYER_ID( getDecodedId( cb->GetId() ) );
if( IsCopperLayer( layer ) )
@@ -180,7 +180,7 @@ void PCB_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event )
// Enable/disable the copper layers visibility:
for( int row=0; row<rowCount; ++row )
{
wxCheckBox* cb = (wxCheckBox*) getLayerComp( row, 3 );
wxCheckBox* cb = (wxCheckBox*) getLayerComp( row, COLUMN_COLOR_LYR_CB );
LAYER_ID layer = ToLAYER_ID( getDecodedId( cb->GetId() ) );
if( IsCopperLayer( layer ) )
@@ -264,7 +264,7 @@ void PCB_LAYER_WIDGET::SyncLayerVisibilities()
// this utilizes more implementation knowledge than ideal, eventually
// add member ROW getRow() or similar to base LAYER_WIDGET.
wxWindow* w = getLayerComp( row, 0 );
wxWindow* w = getLayerComp( row, COLUMN_ICON_ACTIVE );
LAYER_ID layerId = ToLAYER_ID( getDecodedId( w->GetId() ) );