From 0fae86b1ba761d33bdcb22bf40ccf4fcd78e3e14 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 11 Apr 2019 17:36:51 +0200 Subject: [PATCH] Pcbnew: suppress incorrect wx alert when opening the plot dialog from File/Plot menu --- eeschema/dialogs/dialog_edit_component_in_schematic.cpp | 2 +- pcbnew/pcb_edit_frame.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/eeschema/dialogs/dialog_edit_component_in_schematic.cpp b/eeschema/dialogs/dialog_edit_component_in_schematic.cpp index bfd24fb281..92aa5a835f 100644 --- a/eeschema/dialogs/dialog_edit_component_in_schematic.cpp +++ b/eeschema/dialogs/dialog_edit_component_in_schematic.cpp @@ -252,7 +252,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnBrowseLibrary( wxCommandEvent& event for( int ii = 1; ii <= entry->GetUnitCount(); ii++ ) m_unitChoice->Append( LIB_PART::SubReference( ii, false ) ); - if( unit < 0 || unit >= m_unitChoice->GetCount() ) + if( unit < 0 || unit >= (int)m_unitChoice->GetCount() ) unit = 0; m_unitChoice->SetSelection( unit ); diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 8a01f7a45d..7b6a6c5456 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -1109,7 +1109,7 @@ void PCB_EDIT_FRAME::OnSwitchCanvas( wxCommandEvent& aEvent ) void PCB_EDIT_FRAME::ToPlotter( wxCommandEvent& event ) { PCB_PLOT_PARAMS plotSettings = GetPlotSettings(); - +wxMessageBox(wxString::Format("ToPlotter id %d (%d)",event.GetId(),ID_GEN_PLOT_GERBER ) ); switch( event.GetId() ) { case ID_GEN_PLOT_GERBER: plotSettings.SetFormat( PLOT_FORMAT_GERBER ); break; @@ -1118,7 +1118,9 @@ void PCB_EDIT_FRAME::ToPlotter( wxCommandEvent& event ) case ID_GEN_PLOT_PDF: plotSettings.SetFormat( PLOT_FORMAT_PDF ); break; case ID_GEN_PLOT_PS: plotSettings.SetFormat( PLOT_FORMAT_POST ); break; case ID_GEN_PLOT_SVG: wxFAIL_MSG( "Must be handled by ExportSVG()" ); break; - default: wxFAIL_MSG( "Unknown plot type" ); break; + case ID_GEN_PLOT: + default: // called with no specified plot type: keep the previous setup + break; } SetPlotSettings( plotSettings );