Clear Scintilla undo history after setting initial text.

Fixes https://gitlab.com/kicad/code/kicad/issues/12650
This commit is contained in:
Jeff Young 2022-10-14 22:00:54 +01:00
parent 6f9bc0980b
commit 7ffdfb1067
8 changed files with 13 additions and 0 deletions

View File

@ -302,9 +302,14 @@ void DIALOG_FIELD_PROPERTIES::onVAlignButton( wxCommandEvent& aEvent )
bool DIALOG_FIELD_PROPERTIES::TransferDataToWindow() bool DIALOG_FIELD_PROPERTIES::TransferDataToWindow()
{ {
if( m_TextCtrl->IsShown() ) if( m_TextCtrl->IsShown() )
{
m_TextCtrl->SetValue( m_text ); m_TextCtrl->SetValue( m_text );
}
else if( m_StyledTextCtrl->IsShown() ) else if( m_StyledTextCtrl->IsShown() )
{
m_StyledTextCtrl->SetValue( m_text ); m_StyledTextCtrl->SetValue( m_text );
m_StyledTextCtrl->EmptyUndoBuffer();
}
m_fontCtrl->SetFontSelection( m_font ); m_fontCtrl->SetFontSelection( m_font );

View File

@ -126,6 +126,7 @@ bool DIALOG_LIB_TEXT_PROPERTIES::TransferDataToWindow()
{ {
m_textSize.SetValue( m_graphicText->GetTextWidth() ); m_textSize.SetValue( m_graphicText->GetTextWidth() );
m_StyledTextCtrl->SetValue( m_graphicText->GetText() ); m_StyledTextCtrl->SetValue( m_graphicText->GetText() );
m_StyledTextCtrl->EmptyUndoBuffer();
m_fontCtrl->SetFontSelection( m_graphicText->GetFont() ); m_fontCtrl->SetFontSelection( m_graphicText->GetFont() );
m_textColorSwatch->SetSwatchColor( m_graphicText->GetTextColor(), false ); m_textColorSwatch->SetSwatchColor( m_graphicText->GetTextColor(), false );

View File

@ -142,6 +142,7 @@ bool DIALOG_LIB_TEXTBOX_PROPERTIES::TransferDataToWindow()
return false; return false;
m_textCtrl->SetValue( m_currentText->GetText() ); m_textCtrl->SetValue( m_currentText->GetText() );
m_textCtrl->EmptyUndoBuffer();
m_fontCtrl->SetFontSelection( m_currentText->GetFont() ); m_fontCtrl->SetFontSelection( m_currentText->GetFont() );
m_textSize.SetValue( m_currentText->GetTextWidth() ); m_textSize.SetValue( m_currentText->GetTextWidth() );

View File

@ -205,6 +205,7 @@ bool DIALOG_TEXT_PROPERTIES::TransferDataToWindow()
// show text variable cross-references in a human-readable format // show text variable cross-references in a human-readable format
m_textCtrl->SetValue( schematic.ConvertKIIDsToRefs( m_currentText->GetText() ) ); m_textCtrl->SetValue( schematic.ConvertKIIDsToRefs( m_currentText->GetText() ) );
m_textCtrl->EmptyUndoBuffer();
m_fontCtrl->SetFontSelection( m_currentText->GetFont() ); m_fontCtrl->SetFontSelection( m_currentText->GetFont() );
m_textSize.SetValue( m_currentText->GetTextWidth() ); m_textSize.SetValue( m_currentText->GetTextWidth() );

View File

@ -259,6 +259,7 @@ void PROPERTIES_FRAME::CopyPrmsFromItemToPanel( DS_DATA_ITEM* aItem )
// Replace our '\' 'n' sequence by the EOL char // Replace our '\' 'n' sequence by the EOL char
item->ReplaceAntiSlashSequence(); item->ReplaceAntiSlashSequence();
m_stcText->SetValue( item->m_FullText ); m_stcText->SetValue( item->m_FullText );
m_stcText->EmptyUndoBuffer();
msg.Printf( wxT( "%d" ), item->m_IncrementLabel ); msg.Printf( wxT( "%d" ), item->m_IncrementLabel );
m_textCtrlTextIncrement->SetValue( msg ); m_textCtrlTextIncrement->SetValue( msg );

View File

@ -233,6 +233,7 @@ bool DIALOG_TEXT_PROPERTIES::TransferDataToWindow()
m_MultiLineText->SetValue( converted ); m_MultiLineText->SetValue( converted );
m_MultiLineText->SetSelection( -1, -1 ); m_MultiLineText->SetSelection( -1, -1 );
m_MultiLineText->EmptyUndoBuffer();
} }
if( m_item->Type() == PCB_FP_TEXT_T && m_fpText ) if( m_item->Type() == PCB_FP_TEXT_T && m_fpText )

View File

@ -169,6 +169,7 @@ bool DIALOG_TEXTBOX_PROPERTIES::TransferDataToWindow()
m_MultiLineText->SetValue( converted ); m_MultiLineText->SetValue( converted );
m_MultiLineText->SetSelection( -1, -1 ); m_MultiLineText->SetSelection( -1, -1 );
m_MultiLineText->EmptyUndoBuffer();
m_cbLocked->SetValue( m_item->IsLocked() ); m_cbLocked->SetValue( m_item->IsLocked() );

View File

@ -594,6 +594,8 @@ bool PANEL_SETUP_RULES::TransferDataToWindow()
m_textEditor->AddText( str << '\n' ); m_textEditor->AddText( str << '\n' );
} }
m_textEditor->EmptyUndoBuffer();
wxCommandEvent dummy; wxCommandEvent dummy;
OnCompile( dummy ); OnCompile( dummy );
} }