Commit 28222961 authored by Dick Hollenbeck's avatar Dick Hollenbeck

fix ownership issue in wxFFile vs. FILE_LINE_READER

parent 5634bc33
...@@ -188,36 +188,36 @@ const wxString GetPCBDefaultLayerName( int aLayerNumber ) ...@@ -188,36 +188,36 @@ const wxString GetPCBDefaultLayerName( int aLayerNumber )
// Use a switch to explicitly show the mapping more clearly // Use a switch to explicitly show the mapping more clearly
switch( aLayerNumber ) switch( aLayerNumber )
{ {
case LAYER_N_FRONT: txt = _( "Front" ); break; case LAYER_N_FRONT: txt = _( "Front" ); break;
case LAYER_N_2: txt = _( "Inner1" ); break; case LAYER_N_2: txt = _( "Inner1" ); break;
case LAYER_N_3: txt = _( "Inner2" ); break; case LAYER_N_3: txt = _( "Inner2" ); break;
case LAYER_N_4: txt = _( "Inner3" ); break; case LAYER_N_4: txt = _( "Inner3" ); break;
case LAYER_N_5: txt = _( "Inner4" ); break; case LAYER_N_5: txt = _( "Inner4" ); break;
case LAYER_N_6: txt = _( "Inner5" ); break; case LAYER_N_6: txt = _( "Inner5" ); break;
case LAYER_N_7: txt = _( "Inner6" ); break; case LAYER_N_7: txt = _( "Inner6" ); break;
case LAYER_N_8: txt = _( "Inner7" ); break; case LAYER_N_8: txt = _( "Inner7" ); break;
case LAYER_N_9: txt = _( "Inner8" ); break; case LAYER_N_9: txt = _( "Inner8" ); break;
case LAYER_N_10: txt = _( "Inner9" ); break; case LAYER_N_10: txt = _( "Inner9" ); break;
case LAYER_N_11: txt = _( "Inner10" ); break; case LAYER_N_11: txt = _( "Inner10" ); break;
case LAYER_N_12: txt = _( "Inner11" ); break; case LAYER_N_12: txt = _( "Inner11" ); break;
case LAYER_N_13: txt = _( "Inner12" ); break; case LAYER_N_13: txt = _( "Inner12" ); break;
case LAYER_N_14: txt = _( "Inner13" ); break; case LAYER_N_14: txt = _( "Inner13" ); break;
case LAYER_N_15: txt = _( "Inner14" ); break; case LAYER_N_15: txt = _( "Inner14" ); break;
case LAYER_N_BACK: txt = _( "Back" ); break; case LAYER_N_BACK: txt = _( "Back" ); break;
case ADHESIVE_N_BACK: txt = _( "Adhes_Back" ); break; case ADHESIVE_N_BACK: txt = _( "Adhes_Back" ); break;
case ADHESIVE_N_FRONT: txt = _( "Adhes_Front" ); break; case ADHESIVE_N_FRONT: txt = _( "Adhes_Front" ); break;
case SOLDERPASTE_N_BACK: txt = _( "SoldP_Back" ); break; case SOLDERPASTE_N_BACK: txt = _( "SoldP_Back" ); break;
case SOLDERPASTE_N_FRONT: txt = _( "SoldP_Front" ); break; case SOLDERPASTE_N_FRONT: txt = _( "SoldP_Front" ); break;
case SILKSCREEN_N_BACK: txt = _( "SilkS_Back" ); break; case SILKSCREEN_N_BACK: txt = _( "SilkS_Back" ); break;
case SILKSCREEN_N_FRONT: txt = _( "SilkS_Front" ); break; case SILKSCREEN_N_FRONT: txt = _( "SilkS_Front" ); break;
case SOLDERMASK_N_BACK: txt = _( "Mask_Back" ); break; case SOLDERMASK_N_BACK: txt = _( "Mask_Back" ); break;
case SOLDERMASK_N_FRONT: txt = _( "Mask_Front" ); break; case SOLDERMASK_N_FRONT: txt = _( "Mask_Front" ); break;
case DRAW_N: txt = _( "Drawings" ); break; case DRAW_N: txt = _( "Drawings" ); break;
case COMMENT_N: txt = _( "Comments" ); break; case COMMENT_N: txt = _( "Comments" ); break;
case ECO1_N: txt = _( "Eco1" ); break; case ECO1_N: txt = _( "Eco1" ); break;
case ECO2_N: txt = _( "Eco2" ); break; case ECO2_N: txt = _( "Eco2" ); break;
case EDGE_N: txt = _( "PCB_Edges" ); break; case EDGE_N: txt = _( "PCB_Edges" ); break;
default: txt = wxT( "BAD INDEX" ); break; default: txt = wxT( "BAD INDEX" ); break;
} }
return wxString( txt ); return wxString( txt );
......
...@@ -983,20 +983,20 @@ void PCB_IO::format( MODULE* aModule, int aNestLevel ) const ...@@ -983,20 +983,20 @@ void PCB_IO::format( MODULE* aModule, int aNestLevel ) const
void PCB_IO::format( D_PAD* aPad, int aNestLevel ) const void PCB_IO::format( D_PAD* aPad, int aNestLevel ) const
throw( IO_ERROR ) throw( IO_ERROR )
{ {
std::string shape; const char* shape;
switch( aPad->GetShape() ) switch( aPad->GetShape() )
{ {
case PAD_CIRCLE: shape = "circle"; break; case PAD_CIRCLE: shape = "circle"; break;
case PAD_RECT: shape = "rect"; break; case PAD_RECT: shape = "rect"; break;
case PAD_OVAL: shape = "oval"; break; case PAD_OVAL: shape = "oval"; break;
case PAD_TRAPEZOID: shape = "trapezoid"; break; case PAD_TRAPEZOID: shape = "trapezoid"; break;
default: default:
THROW_IO_ERROR( wxString::Format( _( "unknown pad type: %d"), aPad->GetShape() ) ); THROW_IO_ERROR( wxString::Format( _( "unknown pad type: %d"), aPad->GetShape() ) );
} }
std::string type; const char* type;
switch( aPad->GetAttribute() ) switch( aPad->GetAttribute() )
{ {
...@@ -1012,7 +1012,7 @@ void PCB_IO::format( D_PAD* aPad, int aNestLevel ) const ...@@ -1012,7 +1012,7 @@ void PCB_IO::format( D_PAD* aPad, int aNestLevel ) const
m_out->Print( aNestLevel, "(pad %s %s %s", m_out->Print( aNestLevel, "(pad %s %s %s",
m_out->Quotew( aPad->GetPadName() ).c_str(), m_out->Quotew( aPad->GetPadName() ).c_str(),
type.c_str(), shape.c_str() ); type, shape );
m_out->Print( 0, " (at %s", FMT_IU( aPad->GetPos0() ).c_str() ); m_out->Print( 0, " (at %s", FMT_IU( aPad->GetPos0() ).c_str() );
if( aPad->GetOrientation() != 0.0 ) if( aPad->GetOrientation() != 0.0 )
...@@ -1502,7 +1502,7 @@ BOARD* PCB_IO::Load( const wxString& aFileName, BOARD* aAppendToMe, PROPERTIES* ...@@ -1502,7 +1502,7 @@ BOARD* PCB_IO::Load( const wxString& aFileName, BOARD* aAppendToMe, PROPERTIES*
THROW_IO_ERROR( msg ); THROW_IO_ERROR( msg );
} }
FILE_LINE_READER reader( file.fp(), aFileName ); FILE_LINE_READER reader( file.fp(), aFileName, false /* wxFFile owns fp */ );
m_parser->SetLineReader( &reader ); m_parser->SetLineReader( &reader );
m_parser->SetBoard( aAppendToMe ); m_parser->SetBoard( aAppendToMe );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment