From ec44dfa60f2694937f9927ffda32828fef7a2921 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 13 Mar 2022 18:55:55 +0000 Subject: [PATCH] Unescape value fields when pasting from legacy schematics. Fixes https://gitlab.com/kicad/code/kicad/issues/11124 --- eeschema/tools/sch_editor_control.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 31e8bc3a19..8d922fb689 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -1476,8 +1476,13 @@ void SCH_EDITOR_CONTROL::updatePastedSymbol( SCH_SYMBOL* aSymbol, SCH_SCREEN* aP } else { - // Pasted from notepad or an older instance of eeschema. - // Use the values in the fields instead + // Some legacy versions saved value fields escaped. While we still do in the symbol + // editor, we don't anymore in the schematic, so be sure to unescape them. + SCH_FIELD* valueField = aSymbol->GetField( VALUE_FIELD ); + valueField->SetText( UnescapeString( valueField->GetText() ) ); + + // Pasted from notepad or an older instance of eeschema. Use the values in the fields + // instead. reference = aSymbol->GetField( REFERENCE_FIELD )->GetText(); value = aSymbol->GetField( VALUE_FIELD )->GetText(); footprint = aSymbol->GetField( FOOTPRINT_FIELD )->GetText();