kicad2step: Provide floats separated

Clang++ seems to be in left-field here as it processes a stringstream
1.0X1.0 >> double as a hexadecimal floating point ('X' character) and
throws an error rather than converting 1.0 and stopping when it reaches
a non-numeric character.  This causes errors when exporting step on Mac,
which uses clang++ by default.

Adding spaces to the string is more explicit and doesn't break gcc.  It
will be sufficient until we get rid of kicad2step as an external
utility.

Fixes: lp:1778564
* https://bugs.launchpad.net/kicad/+bug/1778564

(cherry picked from commit e7a9643b37)
This commit is contained in:
Seth Hillbrand 2018-09-22 08:45:32 -07:00
parent dd9b0c2dc6
commit 525e26eb82
1 changed files with 2 additions and 2 deletions

View File

@ -298,7 +298,7 @@ void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent )
}
LOCALE_IO dummy;
cmdK2S.Append( wxString::Format( " --user-origin %.6fx%.6f", xOrg, yOrg ) );
cmdK2S.Append( wxString::Format( " --user-origin=\"%.6f x %.6f\"", xOrg, yOrg ) );
}
break;
@ -308,7 +308,7 @@ void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent )
xOrg = Iu2Millimeter( bbox.GetCenter().x );
yOrg = Iu2Millimeter( bbox.GetCenter().y );
LOCALE_IO dummy;
cmdK2S.Append( wxString::Format( " --user-origin %.6fx%.6f", xOrg, yOrg ) );
cmdK2S.Append( wxString::Format( " --user-origin=\"%.6f x %.6f\"", xOrg, yOrg ) );
}
break;
}