Fix some issues in command_export_pcb_gerber.cpp, mainly force "C" locale.

This commit is contained in:
jean-pierre charras 2022-10-30 19:54:26 +01:00
parent 5eca8dd8de
commit ed0462c7a1
1 changed files with 6 additions and 3 deletions

View File

@ -28,6 +28,8 @@
#include <macros.h> #include <macros.h>
#include <wx/tokenzr.h> #include <wx/tokenzr.h>
#include <locale_io.h>
#define ARG_NO_X2 "--no-x2" #define ARG_NO_X2 "--no-x2"
#define ARG_NO_NETLIST "--no-netlist" #define ARG_NO_NETLIST "--no-netlist"
#define ARG_SUBTRACT_SOLDERMASK "--subtract-soldermask" #define ARG_SUBTRACT_SOLDERMASK "--subtract-soldermask"
@ -75,7 +77,7 @@ CLI::EXPORT_PCB_GERBER_COMMAND::EXPORT_PCB_GERBER_COMMAND() : EXPORT_PCB_BASE_CO
m_argParser.add_argument( ARG_PRECISION ) m_argParser.add_argument( ARG_PRECISION )
.help( "Precision of gerber coordinates (5 or 6)" ) .help( "Precision of gerber coordinates (5 or 6)" )
.default_value( 5 ); .default_value( 6 );
} }
@ -85,7 +87,7 @@ int CLI::EXPORT_PCB_GERBER_COMMAND::Perform( KIWAY& aKiway )
if( baseExit != EXIT_CODES::OK ) if( baseExit != EXIT_CODES::OK )
return baseExit; return baseExit;
JOB_EXPORT_PCB_GERBER* gerberJob = new JOB_EXPORT_PCB_GERBER( true ); std::unique_ptr<JOB_EXPORT_PCB_GERBER> gerberJob( new JOB_EXPORT_PCB_GERBER( true ) );
gerberJob->m_filename = FROM_UTF8( m_argParser.get<std::string>( ARG_INPUT ).c_str() ); gerberJob->m_filename = FROM_UTF8( m_argParser.get<std::string>( ARG_INPUT ).c_str() );
gerberJob->m_outputFile = FROM_UTF8( m_argParser.get<std::string>( ARG_OUTPUT ).c_str() ); gerberJob->m_outputFile = FROM_UTF8( m_argParser.get<std::string>( ARG_OUTPUT ).c_str() );
@ -113,7 +115,8 @@ int CLI::EXPORT_PCB_GERBER_COMMAND::Perform( KIWAY& aKiway )
gerberJob->m_printMaskLayer = m_selectedLayers; gerberJob->m_printMaskLayer = m_selectedLayers;
int exitCode = aKiway.ProcessJob( KIWAY::FACE_PCB, gerberJob ); LOCALE_IO dummy;
int exitCode = aKiway.ProcessJob( KIWAY::FACE_PCB, gerberJob.get() );
return exitCode; return exitCode;
} }