Browse Source

Eeschema: add defensive code to symbol library cache I/O.

6.0.7
Wayne Stambaugh 5 years ago
parent
commit
e61f768fbc
  1. 8
      eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp

8
eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp

@ -1442,6 +1442,10 @@ void SCH_SEXPR_PLUGIN_CACHE::Load()
wxString::Format( "Cannot use relative file paths in sexpr plugin to "
"open library \"%s\".", m_libFileName.GetFullPath() ) );
// The current locale must use period as the decimal point.
wxCHECK2( wxLocale::GetInfo( wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER ) == ".",
LOCALE_IO toggle );
wxLogTrace( traceSchLegacyPlugin, "Loading sexpr symbol library file \"%s\"",
m_libFileName.GetFullPath() );
@ -1511,6 +1515,10 @@ void SCH_SEXPR_PLUGIN_CACHE::SaveSymbol( LIB_PART* aSymbol, OUTPUTFORMATTER& aFo
{
wxCHECK_RET( aSymbol, "Invalid LIB_PART pointer." );
// The current locale must use period as the decimal point.
wxCHECK2( wxLocale::GetInfo( wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER ) == ".",
LOCALE_IO toggle );
int lastFieldId;
LIB_FIELDS fields;
std::string name = aFormatter.Quotew( aSymbol->GetLibId().Format().wx_str() );

Loading…
Cancel
Save