Don't allow replace on Power Symbol value fields.
Fixes: lp:1771398 * https://bugs.launchpad.net/kicad/+bug/1771398
This commit is contained in:
parent
8cb68a3585
commit
5e30e4d475
|
@ -368,6 +368,19 @@ bool SCH_FIELD::Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint
|
|||
}
|
||||
|
||||
|
||||
bool SCH_FIELD::IsReplaceable() const
|
||||
{
|
||||
if( m_id != VALUE )
|
||||
return true;
|
||||
|
||||
SCH_COMPONENT* component = dynamic_cast<SCH_COMPONENT*>( GetParent() );
|
||||
LIB_PART* part = component ? component->GetPartRef().lock().get() : nullptr;
|
||||
bool isPower = part ? part->IsPower() : false;
|
||||
|
||||
return !isPower;
|
||||
}
|
||||
|
||||
|
||||
bool SCH_FIELD::Replace( wxFindReplaceData& aSearchData, void* aAuxData )
|
||||
{
|
||||
bool isReplaced;
|
||||
|
|
|
@ -182,7 +182,7 @@ public:
|
|||
|
||||
BITMAP_DEF GetMenuImage() const override;
|
||||
|
||||
bool IsReplaceable() const override { return true; }
|
||||
bool IsReplaceable() const override;
|
||||
|
||||
wxPoint GetLibPosition() const { return EDA_TEXT::GetTextPos(); }
|
||||
|
||||
|
|
Loading…
Reference in New Issue