From 76a68b1f8d8439125ec1269412caeeefc4f46343 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 7 Jun 2024 09:58:54 -0700 Subject: [PATCH] Add missing IsMandatory() fn --- eeschema/sch_field.cpp | 9 +++++++++ eeschema/sch_field.h | 2 ++ 2 files changed, 11 insertions(+) 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;