Pcbnew, multiline graphic text dialog: strip extra \r in EOL (\n is enough) on Windows.

Fixes: lp:1843279
https://bugs.launchpad.net/kicad/+bug/1843279
This commit is contained in:
jean-pierre charras 2019-09-10 10:57:04 +02:00
parent b5742d09f8
commit 2a9157ca99
3 changed files with 659 additions and 650 deletions

File diff suppressed because it is too large Load Diff

View File

@ -403,7 +403,16 @@ bool DIALOG_TEXT_PROPERTIES::TransferDataFromWindow()
else if( m_MultiLineText->IsShown() )
{
if( !m_MultiLineText->GetValue().IsEmpty() )
m_edaText->SetText( m_MultiLineText->GetValue() );
{
// On Windows, a new line is coded as \r\n.
// We use only \n in kicad files and in drawing routines.
// so strip the \r char
wxString txt = m_MultiLineText->GetValue();
#ifdef __WINDOWS__
txt.Replace( "\r", "" );
#endif
m_edaText->SetText( txt );
}
}
else if( m_DimensionText->IsShown() )
{

View File

@ -47,7 +47,7 @@
<property name="minimum_size">-1,-1</property>
<property name="name">DIALOG_TEXT_PROPERTIES_BASE</property>
<property name="pos"></property>
<property name="size">504,463</property>
<property name="size">504,563</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">Text Properties</property>