diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp index 32bc571fb5..9ab30c91da 100644 --- a/eeschema/sch_field.cpp +++ b/eeschema/sch_field.cpp @@ -1295,6 +1295,15 @@ VECTOR2I SCH_FIELD::GetParentPosition() const } +bool SCH_FIELD::IsMandatory() const +{ + if( m_parent && m_parent->Type() == SCH_SHEET_T ) + return m_id >= 0 && m_id < SHEET_MANDATORY_FIELDS; + else + return m_id >= 0 && m_id < MANDATORY_FIELDS; +} + + bool SCH_FIELD::operator <( const SCH_ITEM& aItem ) const { if( Type() != aItem.Type() ) diff --git a/eeschema/sch_field.h b/eeschema/sch_field.h index 967c836713..59bb139866 100644 --- a/eeschema/sch_field.h +++ b/eeschema/sch_field.h @@ -209,6 +209,8 @@ public: */ void ImportValues( const LIB_FIELD& aSource ); + bool IsMandatory() const; + int GetPenWidth() const override; void ClearCaches() override;