From ab74445df45a00fa5b8d40f7b9f0951659ea8187 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sat, 23 Mar 2019 18:51:13 -0400 Subject: [PATCH] Fix loading of components with convert parameter set to zero --- eeschema/sch_legacy_plugin.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/eeschema/sch_legacy_plugin.cpp b/eeschema/sch_legacy_plugin.cpp index 9c99fb86c1..f631dacd1c 100644 --- a/eeschema/sch_legacy_plugin.cpp +++ b/eeschema/sch_legacy_plugin.cpp @@ -1498,7 +1498,21 @@ SCH_COMPONENT* SCH_LEGACY_PLUGIN::loadComponent( FILE_LINE_READER& aReader ) } component->SetUnit( unit ); - component->SetConvert( parseInt( aReader, line, &line ) ); + + // Same can also happen with the convert parameter + int convert = parseInt( aReader, line, &line ); + + if( convert == 0 ) + { + convert = 1; + + // Set the file as modified so the user can be warned. + if( m_rootSheet && m_rootSheet->GetScreen() ) + m_rootSheet->GetScreen()->SetModify(); + } + + component->SetConvert( convert ); + component->SetTimeStamp( parseHex( aReader, line, &line ) ); } else if( strCompare( "P", line, &line ) )