From 9f56b75f013066ff87ada247115694fb531f3371 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 14 Apr 2023 18:43:36 +0100 Subject: [PATCH] Clean up atrophied code. --- eeschema/dialogs/dialog_field_properties.cpp | 20 +------------------- eeschema/dialogs/dialog_field_properties.h | 1 - 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/eeschema/dialogs/dialog_field_properties.cpp b/eeschema/dialogs/dialog_field_properties.cpp index cbae9c3751..ba85836b64 100644 --- a/eeschema/dialogs/dialog_field_properties.cpp +++ b/eeschema/dialogs/dialog_field_properties.cpp @@ -68,9 +68,8 @@ DIALOG_FIELD_PROPERTIES::DIALOG_FIELD_PROPERTIES( SCH_BASE_FRAME* aParent, const m_note->SetFont( KIUI::GetInfoFont( this ).Italic() ); m_note->Show( false ); - // The field ID and power status are Initialized in the derived object's ctor. + // The field ID is initialized in the derived object's ctor. m_fieldId = VALUE_FIELD; - m_isPower = false; m_scintillaTricks = new SCINTILLA_TRICKS( m_StyledTextCtrl, wxT( "{}" ), true, [this]() @@ -422,8 +421,6 @@ DIALOG_LIB_FIELD_PROPERTIES::DIALOG_LIB_FIELD_PROPERTIES( SCH_BASE_FRAME* aParen m_nameVisible->Show(); m_cbAllowAutoPlace->Show(); - // When in the library editor, power symbols can be renamed. - m_isPower = false; init(); } @@ -486,8 +483,6 @@ DIALOG_SCH_FIELD_PROPERTIES::DIALOG_SCH_FIELD_PROPERTIES( SCH_BASE_FRAME* aParen m_font = m_field->GetFont(); - m_isPower = false; - m_textLabel->SetLabel( aField->GetName() + wxS( ":" ) ); m_position = m_field->GetPosition(); @@ -498,19 +493,6 @@ DIALOG_SCH_FIELD_PROPERTIES::DIALOG_SCH_FIELD_PROPERTIES( SCH_BASE_FRAME* aParen m_horizontalJustification = m_field->GetEffectiveHorizJustify(); m_verticalJustification = m_field->GetEffectiveVertJustify(); - // The library symbol may have been removed so using SCH_SYMBOL::GetLibSymbolRef() here - // could result in a segfault. If the library symbol is no longer available, the - // schematic fields can still edit so set the power symbol flag to false. This may not - // be entirely accurate if the power library is missing but it's better then a segfault. - if( aField->GetParent() && aField->GetParent()->Type() == SCH_SYMBOL_T ) - { - const SCH_SYMBOL* symbol = static_cast( aField->GetParent() ); - const LIB_SYMBOL* libSymbol = GetParent()->GetLibSymbol( symbol->GetLibId(), true ); - - if( libSymbol && libSymbol->IsPower() ) - m_isPower = true; - } - m_StyledTextCtrl->Bind( wxEVT_STC_CHARADDED, &DIALOG_SCH_FIELD_PROPERTIES::onScintillaCharAdded, this ); m_StyledTextCtrl->Bind( wxEVT_STC_AUTOCOMP_CHAR_DELETED, diff --git a/eeschema/dialogs/dialog_field_properties.h b/eeschema/dialogs/dialog_field_properties.h index c42fada600..52fc725fc0 100644 --- a/eeschema/dialogs/dialog_field_properties.h +++ b/eeschema/dialogs/dialog_field_properties.h @@ -89,7 +89,6 @@ protected: UNIT_BINDER m_textSize; int m_fieldId; - bool m_isPower; wxString m_text; KIFONT::FONT* m_font; bool m_isItalic;