Commit 69fd16ed authored by dickelbeck's avatar dickelbeck

switch to GetChars() and away from wxString::GetData()

parent 0350744a
...@@ -321,9 +321,7 @@ void SPECCTRA_DB::LoadPCB( const wxString& filename ) throw( IOError ) ...@@ -321,9 +321,7 @@ void SPECCTRA_DB::LoadPCB( const wxString& filename ) throw( IOError )
if( !fp ) if( !fp )
{ {
wxString msg; ThrowIOError( _("Unable to open file \"%s\""), GetChars(filename) );
msg.Printf( _("Unable to open file \"%s\""), filename.GetData() );
ThrowIOError( msg );
} }
file.Attach( fp ); // "exception safe" way to close the file. file.Attach( fp ); // "exception safe" way to close the file.
...@@ -353,9 +351,7 @@ void SPECCTRA_DB::LoadSESSION( const wxString& filename ) throw( IOError ) ...@@ -353,9 +351,7 @@ void SPECCTRA_DB::LoadSESSION( const wxString& filename ) throw( IOError )
if( !fp ) if( !fp )
{ {
wxString msg; ThrowIOError( _("Unable to open file \"%s\""), GetChars(filename) );
msg.Printf( _("Unable to open file \"%s\""), filename.GetData() );
ThrowIOError( msg );
} }
file.Attach( fp ); // "exception safe" way to close the file. file.Attach( fp ); // "exception safe" way to close the file.
...@@ -3470,9 +3466,7 @@ int SPECCTRA_DB::Print( int nestLevel, const char* fmt, ... ) throw( IOError ) ...@@ -3470,9 +3466,7 @@ int SPECCTRA_DB::Print( int nestLevel, const char* fmt, ... ) throw( IOError )
if( result<0 || (result=vfprintf( fp, fmt, args ))<0 ) if( result<0 || (result=vfprintf( fp, fmt, args ))<0 )
{ {
wxString msg; ThrowIOError( _("System file error writing to file \"%s\""), GetChars(filename) );
msg.Printf( _("System file error writing to file \"%s\""), filename.GetData() );
ThrowIOError( msg );
} }
va_end( args ); va_end( args );
...@@ -3529,9 +3523,7 @@ void SPECCTRA_DB::ExportPCB( wxString filename, bool aNameChange ) throw( IOErro ...@@ -3529,9 +3523,7 @@ void SPECCTRA_DB::ExportPCB( wxString filename, bool aNameChange ) throw( IOErro
if( !fp ) if( !fp )
{ {
wxString msg; ThrowIOError( _("Unable to open file \"%s\""), GetChars(filename) );
msg.Printf( _("Unable to open file \"%s\""), filename.GetData() );
ThrowIOError( msg );
} }
if( pcb ) if( pcb )
...@@ -3556,9 +3548,7 @@ void SPECCTRA_DB::ExportSESSION( wxString filename ) ...@@ -3556,9 +3548,7 @@ void SPECCTRA_DB::ExportSESSION( wxString filename )
if( !fp ) if( !fp )
{ {
wxString msg; ThrowIOError( _("Unable to open file \"%s\""), GetChars(filename) );
msg.Printf( _("Unable to open file \"%s\""), filename.GetData() );
ThrowIOError( msg );
} }
if( session ) if( session )
......
...@@ -868,7 +868,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError ) ...@@ -868,7 +868,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
if( module->GetReference() == wxEmptyString ) if( module->GetReference() == wxEmptyString )
{ {
ThrowIOError( _("Component with value of \"%s\" has empty reference id."), ThrowIOError( _("Component with value of \"%s\" has empty reference id."),
module->GetValue().GetData() ); GetChars( module->GetValue() ) );
} }
// if we cannot insert OK, that means the reference has been seen before. // if we cannot insert OK, that means the reference has been seen before.
...@@ -876,7 +876,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError ) ...@@ -876,7 +876,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
if( !refpair.second ) // insert failed if( !refpair.second ) // insert failed
{ {
ThrowIOError( _("Multiple components have identical reference IDs of \"%s\"."), ThrowIOError( _("Multiple components have identical reference IDs of \"%s\"."),
module->GetReference().GetData() ); GetChars( module->GetReference() ) );
} }
} }
} }
......
...@@ -115,7 +115,7 @@ void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event ) ...@@ -115,7 +115,7 @@ void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event )
GetScreen()->SetModify(); GetScreen()->SetModify();
GetBoard()->m_Status_Pcb = 0; GetBoard()->m_Status_Pcb = 0;
/* At this point we should call Compile_Ratsnest() /* At this point we should call Compile_Ratsnest()
* but this could be time consumming. * but this could be time consumming.
* So if incorrect number of Connecred and No connected pads is accepted * So if incorrect number of Connecred and No connected pads is accepted
...@@ -201,7 +201,7 @@ TRACK* SPECCTRA_DB::makeTRACK( PATH* aPath, int aPointIndex, int aNetcode ) thro ...@@ -201,7 +201,7 @@ TRACK* SPECCTRA_DB::makeTRACK( PATH* aPath, int aPointIndex, int aNetcode ) thro
{ {
wxString layerName = CONV_FROM_UTF8( aPath->layer_id.c_str() ); wxString layerName = CONV_FROM_UTF8( aPath->layer_id.c_str() );
ThrowIOError( _("Session file uses invalid layer id \"%s\""), ThrowIOError( _("Session file uses invalid layer id \"%s\""),
layerName.GetData() ); GetChars(layerName) );
} }
TRACK* track = new TRACK( sessionBoard ); TRACK* track = new TRACK( sessionBoard );
...@@ -258,7 +258,7 @@ SEGVIA* SPECCTRA_DB::makeVIA( PADSTACK* aPadstack, const POINT& aPoint, int aNet ...@@ -258,7 +258,7 @@ SEGVIA* SPECCTRA_DB::makeVIA( PADSTACK* aPadstack, const POINT& aPoint, int aNet
DSN_T type = shape->shape->Type(); DSN_T type = shape->shape->Type();
if( type != T_circle ) if( type != T_circle )
ThrowIOError( _( "Unsupported via shape: \"%s\""), ThrowIOError( _( "Unsupported via shape: \"%s\""),
LEXER::GetTokenString( type ).GetData() ); GetChars( LEXER::GetTokenString( type ) ) );
CIRCLE* circle = (CIRCLE*) shape->shape; CIRCLE* circle = (CIRCLE*) shape->shape;
int viaDiam = scale( circle->diameter, routeResolution ); int viaDiam = scale( circle->diameter, routeResolution );
...@@ -276,7 +276,7 @@ SEGVIA* SPECCTRA_DB::makeVIA( PADSTACK* aPadstack, const POINT& aPoint, int aNet ...@@ -276,7 +276,7 @@ SEGVIA* SPECCTRA_DB::makeVIA( PADSTACK* aPadstack, const POINT& aPoint, int aNet
DSN_T type = shape->shape->Type(); DSN_T type = shape->shape->Type();
if( type != T_circle ) if( type != T_circle )
ThrowIOError( _( "Unsupported via shape: \"%s\""), ThrowIOError( _( "Unsupported via shape: \"%s\""),
LEXER::GetTokenString( type ).GetData() ); GetChars( LEXER::GetTokenString( type ) ) );
CIRCLE* circle = (CIRCLE*) shape->shape; CIRCLE* circle = (CIRCLE*) shape->shape;
int viaDiam = scale( circle->diameter, routeResolution ); int viaDiam = scale( circle->diameter, routeResolution );
...@@ -300,7 +300,7 @@ SEGVIA* SPECCTRA_DB::makeVIA( PADSTACK* aPadstack, const POINT& aPoint, int aNet ...@@ -300,7 +300,7 @@ SEGVIA* SPECCTRA_DB::makeVIA( PADSTACK* aPadstack, const POINT& aPoint, int aNet
DSN_T type = shape->shape->Type(); DSN_T type = shape->shape->Type();
if( type != T_circle ) if( type != T_circle )
ThrowIOError( _( "Unsupported via shape: \"%s\""), ThrowIOError( _( "Unsupported via shape: \"%s\""),
LEXER::GetTokenString( type ).GetData() ); GetChars( LEXER::GetTokenString( type ) ) );
CIRCLE* circle = (CIRCLE*) shape->shape; CIRCLE* circle = (CIRCLE*) shape->shape;
...@@ -309,7 +309,7 @@ SEGVIA* SPECCTRA_DB::makeVIA( PADSTACK* aPadstack, const POINT& aPoint, int aNet ...@@ -309,7 +309,7 @@ SEGVIA* SPECCTRA_DB::makeVIA( PADSTACK* aPadstack, const POINT& aPoint, int aNet
{ {
wxString layerName = CONV_FROM_UTF8( circle->layer_id.c_str() ); wxString layerName = CONV_FROM_UTF8( circle->layer_id.c_str() );
ThrowIOError( _("Session file uses invalid layer id \"%s\""), ThrowIOError( _("Session file uses invalid layer id \"%s\""),
layerName.GetData() ); GetChars( layerName ) );
} }
if( layerNdx > topLayerNdx ) if( layerNdx > topLayerNdx )
...@@ -392,7 +392,7 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) throw( IOError ) ...@@ -392,7 +392,7 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) throw( IOError )
{ {
ThrowIOError( ThrowIOError(
_("Session file has 'reference' to non-existent component \"%s\""), _("Session file has 'reference' to non-existent component \"%s\""),
reference.GetData() ); GetChars( reference ) );
} }
if( !place->hasVertex ) if( !place->hasVertex )
...@@ -536,7 +536,7 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) throw( IOError ) ...@@ -536,7 +536,7 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) throw( IOError )
wxString psid( CONV_FROM_UTF8( wire_via->GetPadstackId().c_str() ) ); wxString psid( CONV_FROM_UTF8( wire_via->GetPadstackId().c_str() ) );
ThrowIOError( _("A wire_via references a missing padstack \"%s\""), ThrowIOError( _("A wire_via references a missing padstack \"%s\""),
psid.GetData() ); GetChars( psid ) );
} }
for( unsigned v=0; v<wire_via->vertexes.size(); ++v ) for( unsigned v=0; v<wire_via->vertexes.size(); ++v )
......
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