From 8d92a95cb810ac10bcffe54cece8dac47b96f1d3 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 28 May 2020 19:59:25 +0100 Subject: [PATCH] Fix a couple of issues with text var autocomplete. Fixes https://gitlab.com/kicad/code/kicad/issues/4190 --- eeschema/sch_component.cpp | 5 ++++- eeschema/sch_validators.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index 595231c06f..5bfd54ee30 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -785,7 +785,10 @@ void SCH_COMPONENT::SwapData( SCH_ITEM* aItem ) void SCH_COMPONENT::GetContextualTextVars( wxArrayString* aVars ) const { for( int i = 0; i < MANDATORY_FIELDS; ++i ) - aVars->push_back( m_Fields[i].GetCanonicalName() ); + aVars->push_back( m_Fields[i].GetCanonicalName().Upper() ); + + for( size_t i = MANDATORY_FIELDS; i < m_Fields.size(); ++i ) + aVars->push_back( m_Fields[i].GetName() ); aVars->push_back( wxT( "FOOTPRINT_LIBRARY" ) ); aVars->push_back( wxT( "FOOTPRINT_NAME" ) ); diff --git a/eeschema/sch_validators.cpp b/eeschema/sch_validators.cpp index 329c6720d4..f97946e73c 100644 --- a/eeschema/sch_validators.cpp +++ b/eeschema/sch_validators.cpp @@ -80,7 +80,7 @@ SCH_FIELD_VALIDATOR::SCH_FIELD_VALIDATOR( const SCH_FIELD_VALIDATOR& aValidator bool SCH_FIELD_VALIDATOR::Validate( wxWindow *aParent ) { // If window is disabled, simply return - if( !m_validatorWindow->IsEnabled() ) + if( !m_validatorWindow->IsEnabled() || !m_validatorWindow->IsShown() ) return true; wxTextEntry * const text = GetTextEntry();