From 80c5b1efb1e3f526012de31376c298eb97175a2a Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Sat, 13 Nov 2021 12:57:18 -0500 Subject: [PATCH] File formatting improvements and fixes. Symbol library IDs included the library nickname which is incorrect and meaningless since it will be overwritten by the symbol library table code. This is not a file format change as there are no behavioral differences. --- eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp | 4 ++-- pcbnew/plugins/kicad/kicad_plugin.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp b/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp index b3d378640e..37fb68654d 100644 --- a/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp +++ b/eeschema/sch_plugins/kicad/sch_sexpr_plugin.cpp @@ -305,7 +305,7 @@ static void formatCircle( OUTPUTFORMATTER* aFormatter, int aNestLevel, EDA_SHAPE const STROKE_PARAMS& aStroke, FILL_T aFillMode, const COLOR4D& aFillColor, KIID aUuid = niluuid ) { - aFormatter->Print( aNestLevel, "(circle (center %s %s) (radius %s) ", + aFormatter->Print( aNestLevel, "(circle (center %s %s) (radius %s)\n", FormatInternalUnits( aCircle->GetStart().x ).c_str(), FormatInternalUnits( aCircle->GetStart().y ).c_str(), FormatInternalUnits( aCircle->GetRadius() ).c_str() ); @@ -1738,7 +1738,7 @@ void SCH_SEXPR_PLUGIN_CACHE::SaveSymbol( LIB_SYMBOL* aSymbol, OUTPUTFORMATTER& a int nextFreeFieldId = MANDATORY_FIELDS; std::vector fields; - std::string name = aFormatter.Quotew( aSymbol->GetLibId().Format().wx_str() ); + std::string name = aFormatter.Quotew( aSymbol->GetLibId().GetLibItemName().wx_str() ); std::string unitName = aSymbol->GetLibId().GetLibItemName(); if( !aLibName.IsEmpty() ) diff --git a/pcbnew/plugins/kicad/kicad_plugin.cpp b/pcbnew/plugins/kicad/kicad_plugin.cpp index 478b69ee0a..6c6c76f2bc 100644 --- a/pcbnew/plugins/kicad/kicad_plugin.cpp +++ b/pcbnew/plugins/kicad/kicad_plugin.cpp @@ -1111,7 +1111,7 @@ void PCB_IO::format( const FOOTPRINT* aFootprint, int aNestLevel ) const m_out->Quotes( aFootprint->GetFPID().Format() ).c_str() ); if( !( m_ctl & CTL_OMIT_FOOTPRINT_VERSION ) ) - m_out->Print( 0, " (version %d) (generator pcbnew)", SEXPR_BOARD_FILE_VERSION ); + m_out->Print( 0, " (version %d) (generator pcbnew)\n ", SEXPR_BOARD_FILE_VERSION ); if( aFootprint->IsLocked() ) m_out->Print( 0, " locked" );