Escape PCB text
Also keep a fail-safe for unescaping strings that are not previously escaped Fixes https://gitlab.com/kicad/code/kicad/issues/6901
This commit is contained in:
parent
3ba17e0a16
commit
f8f34982c0
|
@ -198,6 +198,7 @@ wxString UnescapeString( const wxString& aSource )
|
|||
else if( token == wxS( "tab" ) ) newbuf.append( wxS( "\t" ) );
|
||||
else if( token == wxS( "return" ) ) newbuf.append( wxS( "\n" ) );
|
||||
else if( token == wxS( "brace" ) ) newbuf.append( wxS( "{" ) );
|
||||
else if( token.IsEmpty() ) newbuf.append( wxS( "{" ) );
|
||||
else
|
||||
{
|
||||
newbuf.append( "{" + UnescapeString( token ) + "}" );
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <board_commit.h>
|
||||
#include <board.h>
|
||||
#include <footprint.h>
|
||||
#include <kicad_string.h>
|
||||
#include <pcb_text.h>
|
||||
#include <fp_text.h>
|
||||
#include <pcb_edit_frame.h>
|
||||
|
@ -345,7 +346,9 @@ bool DIALOG_TEXT_PROPERTIES::TransferDataFromWindow()
|
|||
if( !m_MultiLineText->GetValue().IsEmpty() )
|
||||
{
|
||||
BOARD* board = m_Parent->GetBoard();
|
||||
wxString txt = board->ConvertCrossReferencesToKIIDs( m_MultiLineText->GetValue() );
|
||||
wxString txt = EscapeString(
|
||||
board->ConvertCrossReferencesToKIIDs( m_MultiLineText->GetValue() ),
|
||||
CTX_QUOTED_STR );
|
||||
|
||||
// On Windows, a new line is coded as \r\n.
|
||||
// We use only \n in kicad files and in drawing routines.
|
||||
|
|
Loading…
Reference in New Issue