From 8745691da3ea521824151b5fdbca53574f5b9f71 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 15 Feb 2021 09:08:48 -0800 Subject: [PATCH] Toggle LOCALE_IO before re-caching cacheLib() can cause a re-load event, which requires the C-locale. LOCALE_IO needs to be set before this event to prevent mistaken ','/'.' mixups Fixes https://gitlab.com/kicad/code/kicad/issues/6434 --- eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp | 2 ++ eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp b/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp index 977de480ba..f9d91982b3 100644 --- a/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp +++ b/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp @@ -2167,6 +2167,7 @@ LIB_PART* SCH_SEXPR_PLUGIN::LoadSymbol( const wxString& aLibraryPath, const wxSt void SCH_SEXPR_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_PART* aSymbol, const PROPERTIES* aProperties ) { + LOCALE_IO toggle; // toggles on, then off, the C locale. m_props = aProperties; cacheLib( aLibraryPath ); @@ -2181,6 +2182,7 @@ void SCH_SEXPR_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_PART* void SCH_SEXPR_PLUGIN::DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName, const PROPERTIES* aProperties ) { + LOCALE_IO toggle; // toggles on, then off, the C locale. m_props = aProperties; cacheLib( aLibraryPath ); diff --git a/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp b/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp index d7023dc3bc..3fe183a8fb 100644 --- a/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp +++ b/eeschema/sch_plugins/legacy/sch_legacy_plugin.cpp @@ -4314,6 +4314,7 @@ LIB_PART* SCH_LEGACY_PLUGIN::LoadSymbol( const wxString& aLibraryPath, const wxS void SCH_LEGACY_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_PART* aSymbol, const PROPERTIES* aProperties ) { + LOCALE_IO toggle; // toggles on, then off, the C locale. m_props = aProperties; cacheLib( aLibraryPath ); @@ -4328,6 +4329,7 @@ void SCH_LEGACY_PLUGIN::SaveSymbol( const wxString& aLibraryPath, const LIB_PART void SCH_LEGACY_PLUGIN::DeleteSymbol( const wxString& aLibraryPath, const wxString& aSymbolName, const PROPERTIES* aProperties ) { + LOCALE_IO toggle; // toggles on, then off, the C locale. m_props = aProperties; cacheLib( aLibraryPath );