Escape/unescape footprint descriptions and keywords when writing/reading cache file.

Fixes: lp:1803989
* https://bugs.launchpad.net/kicad/+bug/1803989
This commit is contained in:
Jeff Young 2018-11-20 21:43:31 +00:00
parent d6ac303a8c
commit ed27027ab1
1 changed files with 4 additions and 4 deletions

View File

@ -357,8 +357,8 @@ void FOOTPRINT_LIST_IMPL::WriteCacheToFile( wxTextFile* aCacheFile )
{
aCacheFile->AddLine( fpinfo->GetLibNickname() );
aCacheFile->AddLine( fpinfo->GetName() );
aCacheFile->AddLine( fpinfo->GetDescription() );
aCacheFile->AddLine( fpinfo->GetKeywords() );
aCacheFile->AddLine( EscapeString( fpinfo->GetDescription() ) );
aCacheFile->AddLine( EscapeString( fpinfo->GetKeywords() ) );
aCacheFile->AddLine( wxString::Format( "%d", fpinfo->GetOrderNum() ) );
aCacheFile->AddLine( wxString::Format( "%u", fpinfo->GetPadCount() ) );
aCacheFile->AddLine( wxString::Format( "%u", fpinfo->GetUniquePadCount() ) );
@ -386,8 +386,8 @@ void FOOTPRINT_LIST_IMPL::ReadCacheFromFile( wxTextFile* aCacheFile )
{
wxString libNickname = aCacheFile->GetNextLine();
wxString name = aCacheFile->GetNextLine();
wxString description = aCacheFile->GetNextLine();
wxString keywords = aCacheFile->GetNextLine();
wxString description = UnescapeString( aCacheFile->GetNextLine() );
wxString keywords = UnescapeString( aCacheFile->GetNextLine() );
int orderNum = wxAtoi( aCacheFile->GetNextLine() );
unsigned int padCount = (unsigned) wxAtoi( aCacheFile->GetNextLine() );
unsigned int uniquePadCount = (unsigned) wxAtoi( aCacheFile->GetNextLine() );