From 83a56263d0e3fb3413ad436596094538bb5fb202 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 24 Jul 2018 16:40:50 +0100 Subject: [PATCH] Strip returns, tabs and linefeeds from SCH fields. Fixes: lp:1783285 * https://bugs.launchpad.net/kicad/+bug/1783285 --- eeschema/dialogs/dialog_fields_editor_global.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/eeschema/dialogs/dialog_fields_editor_global.cpp b/eeschema/dialogs/dialog_fields_editor_global.cpp index 7662d1dc37..65663d371b 100644 --- a/eeschema/dialogs/dialog_fields_editor_global.cpp +++ b/eeschema/dialogs/dialog_fields_editor_global.cpp @@ -301,11 +301,16 @@ public: if( aCol == REFERENCE || aCol == QUANTITY_COLUMN ) return; // Can't modify references or quantity + wxString value( aValue ); + value.Replace( "\r", "\\r" ); + value.Replace( "\n", "\\n" ); + value.Replace( "\t", "\\t" ); + DATA_MODEL_ROW& rowGroup = m_rows[ aRow ]; wxString fieldName = m_fieldNames[ aCol ]; for( const auto& ref : rowGroup.m_Refs ) - m_dataStore[ ref.GetComp()->GetTimeStamp() ][ fieldName ] = aValue; + m_dataStore[ ref.GetComp()->GetTimeStamp() ][ fieldName ] = value; m_edited = true; }