From bee3d78d78e897e3bc6bccc41cbed8a24ff149b8 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 20 Aug 2021 11:47:27 -0700 Subject: [PATCH] Limit Eeschema find/replace entries Standardize maximum find/replace entries to 10 Fixes https://gitlab.com/kicad/code/kicad/issues/9007 --- eeschema/dialogs/dialog_schematic_find.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/eeschema/dialogs/dialog_schematic_find.cpp b/eeschema/dialogs/dialog_schematic_find.cpp index b0a819f787..37e57443ea 100644 --- a/eeschema/dialogs/dialog_schematic_find.cpp +++ b/eeschema/dialogs/dialog_schematic_find.cpp @@ -296,6 +296,12 @@ void DIALOG_SCH_FIND::SetFindEntries( const wxArrayString& aEntries ) { m_comboFind->Append( aEntries ); + while( m_comboFind->GetCount() > 10 ) + { + m_frame->GetFindHistoryList().pop_back(); + m_comboFind->Delete( 9 ); + } + if( m_comboFind->GetCount() ) { m_comboFind->SetSelection( 0 ); @@ -308,6 +314,12 @@ void DIALOG_SCH_FIND::SetReplaceEntries( const wxArrayString& aEntries ) { m_comboReplace->Append( aEntries ); + while( m_comboReplace->GetCount() > 10 ) + { + m_frame->GetFindHistoryList().pop_back(); + m_comboReplace->Delete( 9 ); + } + if( m_comboReplace->GetCount() ) { m_comboReplace->SetSelection( 0 );