From 14f5ef4078ffa7b7d45177c5e422b5bc7be0e1d9 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 22 May 2020 20:25:43 +0200 Subject: [PATCH] Eeschema: ensure component edit flags are cleared after loading a schematic file. Fixes #4515 https://gitlab.com/kicad/code/kicad/issues/4515 --- eeschema/sch_component.cpp | 5 +++++ eeschema/sch_sexpr_parser.cpp | 3 +++ 2 files changed, 8 insertions(+) diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index aae2bb8ed3..a78cb32099 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -1182,6 +1182,11 @@ void SCH_COMPONENT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, MSG_PANEL_ITEMS& aL aList.push_back( MSG_PANEL_ITEM( msg, GetField( VALUE )->GetShownText(), DARKCYAN ) ); +#if 0 // Display component flags, for debug only + aList.push_back( MSG_PANEL_ITEM( _( "flags" ), + wxString::Format("%X", GetEditFlags()), BROWN ) ); +#endif + // Display component reference in library and library aList.push_back( MSG_PANEL_ITEM( _( "Name" ), GetLibId().GetLibItemName(), BROWN ) ); diff --git a/eeschema/sch_sexpr_parser.cpp b/eeschema/sch_sexpr_parser.cpp index 8b884af328..0978e36a77 100644 --- a/eeschema/sch_sexpr_parser.cpp +++ b/eeschema/sch_sexpr_parser.cpp @@ -2193,6 +2193,9 @@ SCH_COMPONENT* SCH_SEXPR_PARSER::parseSchematicSymbol() if( !libName.IsEmpty() && ( symbol->GetLibId().Format().wx_str() != libName ) ) symbol->SetSchSymbolLibraryName( libName ); + // Ensure edit/status flags are cleared after these initializations: + symbol->ClearFlags(); + return symbol.release(); }