From 40bdd26e399b470edba3e669102169b897f59614 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 17 Mar 2022 16:21:38 -0700 Subject: [PATCH] Revert "Make sure LIB_ID escape context allows for formatting constructs." This reverts commit 02252be29d2651ab3d8c09d98891d4ce7005e603. --- common/string_utils.cpp | 14 ++------------ eeschema/dialogs/dialog_lib_symbol_properties.cpp | 2 +- eeschema/fields_grid_table.cpp | 2 +- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/common/string_utils.cpp b/common/string_utils.cpp index 552a228e08..a8f17bc183 100644 --- a/common/string_utils.cpp +++ b/common/string_utils.cpp @@ -142,15 +142,7 @@ bool ConvertSmartQuotesAndDashes( wxString* aString ) wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext ) { - wxString converted; - std::vector braceStack; // true == formatting construct - - auto hasFormattingPrefix = - [&]() - { - static wxString prefixes = wxT( "~_^" ); - return !converted.IsEmpty() && prefixes.Find( converted.Last() ) >= 0; - }; + wxString converted; converted.reserve( aSource.length() ); @@ -167,7 +159,7 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext ) } else if( aContext == CTX_LIBID ) { - if( c == '{' && !hasFormattingPrefix() ) + if( c == '{' ) converted += wxT( "{brace}" ); else if( c == '/' ) converted += wxT( "{slash}" ); @@ -235,9 +227,7 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext ) converted += c; } else - { converted += c; - } } return converted; diff --git a/eeschema/dialogs/dialog_lib_symbol_properties.cpp b/eeschema/dialogs/dialog_lib_symbol_properties.cpp index 42b15e9f58..2f20ed2621 100644 --- a/eeschema/dialogs/dialog_lib_symbol_properties.cpp +++ b/eeschema/dialogs/dialog_lib_symbol_properties.cpp @@ -448,7 +448,7 @@ void DIALOG_LIB_SYMBOL_PROPERTIES::OnGridCellChanging( wxGridEvent& event ) void DIALOG_LIB_SYMBOL_PROPERTIES::OnSymbolNameText( wxCommandEvent& event ) { - if( !m_Parent->IsSymbolFromSchematic() || m_OptionPower->IsChecked() ) + if( !m_Parent->IsSymbolFromSchematic() ) m_grid->SetCellValue( VALUE_FIELD, FDC_VALUE, m_SymbolNameCtrl->GetValue() ); } diff --git a/eeschema/fields_grid_table.cpp b/eeschema/fields_grid_table.cpp index 9dee31f719..9c5f95471e 100644 --- a/eeschema/fields_grid_table.cpp +++ b/eeschema/fields_grid_table.cpp @@ -502,7 +502,7 @@ void FIELDS_GRID_TABLE::SetValue( int aRow, int aCol, const wxString &aValue value = fn.GetFullPath(); } } - else if( m_parentType == SCH_SYMBOL_T && aRow == VALUE_FIELD ) + else if( m_frame->IsType( FRAME_SCH_SYMBOL_EDITOR ) && aRow == VALUE_FIELD ) { value = EscapeString( value, CTX_LIBID ); }