Minor schematic formatter fix.

Apparently at some point in KiCad's development, a '~' character was
prefixed to the symbol name to indicate that it was not visible.  The
visibility state is now saved in the name field so remove the prefix.
The parser was kept unchanged.

Fixes lp:1632048

https://bugs.launchpad.net/kicad/+bug/1632048
This commit is contained in:
Wayne Stambaugh 2019-04-04 09:48:57 -04:00
parent 0aa8458d04
commit ee14da3093
1 changed files with 6 additions and 14 deletions

View File

@ -3638,15 +3638,7 @@ void SCH_LEGACY_PLUGIN_CACHE::SaveSymbol( LIB_PART* aSymbol,
// Save data
aFormatter.Print( 0, "DEF" );
if( value.IsVisible() )
{
aFormatter.Print( 0, " %s", TO_UTF8( value.GetText() ) );
}
else
{
aFormatter.Print( 0, " ~%s", TO_UTF8( value.GetText() ) );
}
aFormatter.Print( 0, " %s", TO_UTF8( value.GetText() ) );
LIB_FIELD& reference = aSymbol->GetReferenceField();
@ -3660,11 +3652,11 @@ void SCH_LEGACY_PLUGIN_CACHE::SaveSymbol( LIB_PART* aSymbol,
}
aFormatter.Print( 0, " %d %d %c %c %d %c %c\n",
0, aSymbol->GetPinNameOffset(),
aSymbol->ShowPinNumbers() ? 'Y' : 'N',
aSymbol->ShowPinNames() ? 'Y' : 'N',
aSymbol->GetUnitCount(), aSymbol->UnitsLocked() ? 'L' : 'F',
aSymbol->IsPower() ? 'P' : 'N' );
0, aSymbol->GetPinNameOffset(),
aSymbol->ShowPinNumbers() ? 'Y' : 'N',
aSymbol->ShowPinNames() ? 'Y' : 'N',
aSymbol->GetUnitCount(), aSymbol->UnitsLocked() ? 'L' : 'F',
aSymbol->IsPower() ? 'P' : 'N' );
timestamp_t dateModified = aSymbol->GetDateLastEdition();