diff --git a/common/legacy_wx/eda_draw_frame.cpp b/common/legacy_wx/eda_draw_frame.cpp index 442e1c67b5..905d7385d3 100644 --- a/common/legacy_wx/eda_draw_frame.cpp +++ b/common/legacy_wx/eda_draw_frame.cpp @@ -1342,14 +1342,14 @@ bool EDA_DRAW_FRAME::saveCanvasTypeSetting( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvas // a parent frame) FRAME_T allowed_frames[] = { - FRAME_SCH, FRAME_PCB, FRAME_PCB_MODULE_EDITOR + FRAME_SCH, FRAME_PCB, FRAME_PCB_MODULE_EDITOR, FRAME_GERBER }; bool allow_save = false; - for( int ii = 0; ii < 3; ii++ ) + for( FRAME_T frame : allowed_frames ) { - if( m_Ident == allowed_frames[ii] ) + if( m_Ident == frame ) { allow_save = true; break; diff --git a/gerbview/events_called_functions.cpp b/gerbview/events_called_functions.cpp index 6095cf953e..de7c87dc73 100644 --- a/gerbview/events_called_functions.cpp +++ b/gerbview/events_called_functions.cpp @@ -553,19 +553,15 @@ void GERBVIEW_FRAME::OnUpdateSwitchCanvas( wxUpdateUIEvent& aEvent ) { wxMenuBar* menuBar = GetMenuBar(); EDA_DRAW_PANEL_GAL* gal_canvas = GetGalCanvas(); - EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE; - - if( IsGalCanvasActive() && gal_canvas ) - canvasType = gal_canvas->GetBackend(); + EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = gal_canvas->GetBackend(); struct { int menuId; int galType; } menuList[] = { - { ID_MENU_CANVAS_LEGACY, EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE }, { ID_MENU_CANVAS_OPENGL, EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL }, { ID_MENU_CANVAS_CAIRO, EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO }, }; - for( auto ii: menuList ) + for( auto ii : menuList ) { wxMenuItem* item = menuBar->FindItem( ii.menuId ); if( ii.galType == canvasType )